0

How should one properly restart sshd or otherwise let it know that its configuration file has changed? Apparently sudo restart sshd is no longer the proper way to do this, as attempting to do so gives

restart: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
2
  • 1
    please edit your question and add the version of Ubuntu your are using to perform this action ?
    – ran
    Dec 23, 2017 at 7:17
  • 1
    You may be on a Ubuntu that is systemd based ( 16.04 and newer ). In that case you have to use systemctl restart sshd. To check the config you can use sudo sshd -t.
    – Thomas
    Dec 23, 2017 at 8:07

2 Answers 2

4

The command should be:

sudo service ssh restart

or:

sudo systemctl restart ssh.service
0
1

The proper way to do this is as follows:

systemctl reload sshd.service

Restart will cause the entire process to be restarted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .