How to start sshd automatically

7,881

systemctl enable sshd.service

This will set ssh to automatically start.

Share:
7,881

Related videos on Youtube

ddev
Author by

ddev

Updated on September 18, 2022

Comments

  • ddev
    ddev almost 2 years

    I'm having an issue with ssh. My idea was to set up Wake on Lan on my pc, which runs Kali Linux Rolling (2008.1), and using ssh to connect to it after it booted.

    Everything works fine, except for the fact that after the pc is booted I can't connect to ssh. To do that, I need to log on from my pc, start ssh and then connect remotely.

    Obviously the problem is that the ssh service stops itself after powering off the pc and it doesn't start automatically once the pc is booted. Is there a way to solve this problem? I mean, there must be.

    • Tim Kennedy
      Tim Kennedy about 6 years
      Are you shutting down your computer, or just letting it go to sleep? You should just enable your ssh service, and let systemd manage the service. Then it will be running when your PC wakes from WOL.
    • ddev
      ddev about 6 years
      I am using Kali Rolling (2018.1). I'm actually completely shutting down the computer
  • ddev
    ddev about 6 years
    yes but will it start even without logging in?
  • Jeff Schaller
    Jeff Schaller about 6 years
    Being based on recent Debian, Kali uses systemd.