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.

closed as unclear what you're asking by Rui F Ribeiro, Christopher, Jesse_b, GAD3R, Archemar Apr 6 '18 at 9:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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. – Tim Kennedy Apr 5 '18 at 18:29
  • I am using Kali Rolling (2018.1). I'm actually completely shutting down the computer – Deci Apr 5 '18 at 18:50

systemctl enable sshd.service

This will set ssh to automatically start.

  • yes but will it start even without logging in? – Deci Apr 5 '18 at 19:29
  • Yes. It will be started as part of the system startup process and it will run as a service. This is how servers get processes to run without having anyone log into the system. – JohnA Apr 5 '18 at 19:35

Check whether chkconfig is enabled for service or not

Chkconfig --list | grep -I sshd to check service enabled on boot or not

If it's not enabled enable by below. Command

Chkconfig --level 35 sshd on

Mentioned. Command will work in all version of redhat cenis except 7

  • Being based on recent Debian, Kali uses systemd. – Jeff Schaller Apr 6 '18 at 15:34

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