6

I'm using Linux Mint Debian v2, 64-bit.

I noticed recently that my ssh daemon does not start automatically on boot. It used to. I'm not sure if it had to do with my UFW configuration or sshd_config configurations, but, it doesn't start now unless I put:

sudo service ssh start

I've searched the net and I could find some solutions such as:

sudo update-rc.d ssh defaults

and creating an sshd file in /etc/init.d, but, they didn't work.

I've tried purging ssh and openssh-server and re-installing. But, that didn't have any effect. It started automatically after re-installing, but, once I rebooted and checked for the ssh daemon, it wouldn't show up. 

Any suggestions on how I can get it to start on boot?

4

Assuming you have installed openssh-server , check for sshd startup symbolic links at /etc/rc{2,3,4,5} directories , run ls -l /etc/rc?.d/*ssh if no startup links there , create them by running:

sudo update-rc.d ssh defaults

and reboot.

If problem not solved yet, you may try it by placing service ssh start (before the "exit 0" line) at /etc/rc.local file and reboot again.

3

Actually it is simple with systemctl

~ $ sudo systemctl enable ssh.service synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable ssh Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.

Either reboot to activate or use

~ $ sudo systemctl start ssh.service

1

I figured it out. As I posted in my other post: Is there a specific SSH boot log?

In my auth.log file, it wasn't binding to the IP address I put in for the ListenAddress parameter in /etc/ssh/sshd_config. After I changed it back to 0.0.0.0, it starts up now. Don't quite understand, I thought I could put the IP address of my computer?

And I don't understand why it doesn't start at boot, yet, manually, it can start.

  • 1
    ListenAddress 0.0.0.0 works for me. :D Thanks. – Brijesh Valera Sep 28 '15 at 4:44
0

I have the same problem on a raspberry, my quick and dirty solution was update-rc.d disable abd I put service ssh start in my rc.local.

maybe in your case a service ssh enable will help,...

0

This fixed it for me:

crontab -e

Then add this line in the bottom:

@reboot sleep 15 && /bin/systemctl restart sshd

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.