How to start SSH daemon on boot on Linux Mint Debian v2

40,517

Solution 1

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.

Solution 2

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

Solution 3

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.

Solution 4

This fixed it for me:

crontab -e

Then add this line in the bottom:

@reboot sleep 15 && /bin/systemctl restart sshd
Share:
40,517

Related videos on Youtube

linstar
Author by

linstar

Updated on September 18, 2022

Comments

  • linstar
    linstar over 1 year

    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?

  • Brijesh Valera
    Brijesh Valera over 8 years
    ListenAddress 0.0.0.0 works for me. :D Thanks.
  • DanRan
    DanRan over 4 years
    I also am using a ListenAddress in my sshd_config file other than 0.0.0.0. None of the solutions on this page worked except changing the ListenAddress back to 0.0.0.0. Does anyone have any REAL solutions or answers as to why this is the case?
  • Timo
    Timo almost 3 years
    Is this all to do: sudo systemctl enable ssh.service and then reboot? sysv seems to be the old system before systemd.