Ask Your Question

How to keep sshd alive after restart?

asked 2014-01-11 04:36:24 +0000

das gravatar image

Every time I want to use ssh, I have to make it alive by issuing 'service sshd start' as superuser. In earlier versions of fedora, I would issue 'systemctl sshd on' as superuser, and this would keep sshd alive even after a restart. But, now, when I issue 'systemctl sshd on' as superuser, the system cannot recognize 'sshd'. Every time after reboot, I have to activate ssh once again through 'service sshd start' as superuser, or I cannot access this machine from any other machine on LAN.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-01-11 06:07:06 +0000

To start a service:

systemctl start $servicename

To enable a service to start on reboots:

systemctl enable $servicename

This syntax has never changed, and systemctl sshd on has never been correct. sshd should also be enabled by default.

edit flag offensive delete link more

answered 2014-01-11 13:59:49 +0000

das gravatar image

updated 2014-01-11 14:12:31 +0000

No ssh was not enabled in default. Now, as superuser I issued the following command:

[root@mamdo ~]# systemctl enable sshd ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service'

I don't understand the creation of the symbolic link, and I am going to check now if sshd remains active on reboot.

Yes, I checked it after reboot with 'systemctl status sshd' as the superuser. Thank you for the help.

edit flag offensive delete link more


Yes, it worked. After reboot I checked with 'systemctl status sshd'.

das ( 2014-01-11 14:07:05 +0000 )edit

The purpose for the symbolic link, I believe, is to "link" the sshd.service file to a directory that systemd reads during bootup. By putting a service file in that directory, its considered "enabled".

radioact1ve ( 2014-01-11 15:28:35 +0000 )edit

Hello, I tried this solution, since I have the same problem, but I got this message: Failed to parse signal string /usr/lib/systemd/system/sshd.service. [ My system is Fedora20 ]

hookie ( 2014-05-11 13:26:34 +0000 )edit

hookie, me too. So I tried to execute only the symbolic lynk part, and it worked! ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service' and then 'systemctl enable sshd' finally worked! Thank you for the solution.

Francesco Riggio ( 2014-08-20 09:25:34 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

1 follower


Asked: 2014-01-11 04:36:24 +0000

Seen: 1,252 times

Last updated: Jan 11 '14