I am connected to a computer over ssh. I have to reboot it remotely, while making sure that I will be able to reconnect to it over ssh just after reboot. I install 'bum' and marked sshd to be automatically started on boot. Is there a way to be completely sure that sshd will automatically start after reboot. Any help would be appreciated.


There are some ways. You can create a cronjob which runs at reboot to start the SSH daemon. You can create a script which runs when the network comes up and starts the SSH daemon (via Network Manager's dispatcher facility, for example). You could add a command to /etc/rc.local to start the SSH service. You could write an Upstart job (and thus duplicate some work).

However, the fact is that the SSH service is autostarted by default. As long as the network comes up fine, you should be able to SSH into the system. If the SSH service failed for some reason, there's a good chance none of the aforementioned methods would have worked anyway.

  • you're completely right! The good thing about having ssh started by a background script, is that if someone's so clever to shut down the service, it can automatically be restarted. BUT, as you've mentioned, there are always instances when SSHD cannot be started. For those situations, a remote access card is the only solution (e.g. Dell's DRAC or HP's ILO cards). There is no 100% guarantee that any service will come up properly, not ever. And yes, when you install the ssh-server package from the repository, it will automatically be started at boot (if all goes well). – Jakke Jun 21 '14 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.