I have observed that if I use any of the following commands to reboot my RPi 2B:
$ sudo reboot
$ sudo shutdown -r now
$ sudo shutdown -Hr now
and then try to SSH into the Pi, I get a Connection Refused error. It pings normally, though. Then I have to go to the Pi, restart the power supply. Then I can SSH into it normally, after it boots up again.
How do I remotely restart the pi, while maintaining SSH access after it boots?
I didn't have this problem before. I have touched the /etc/fstab, the firewall, keep USB drives plugged in it and am running HAP-NodeJS on it currently. This loads up on startup (with cron). pkilling it (node, not cron) before reboot doesn't work.
Thanks in advance
P.S. Earlier, even restarting the power wasn't working. It turned out to that a drive in /etc/fstab that was set to auto was unplugged.
Now, every time I have to reboot it, I have to restart the power supply to use SSH, or start any program.