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
  • 1
    please edit your question and add the version of Ubuntu your are using to perform this action ? – ran Dec 23 '17 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 '17 at 8:07

The command should be:

sudo service ssh restart


sudo systemctl restart ssh.service
| improve this answer | |

The proper way to do this is as follows:

systemctl reload sshd.service

Restart will cause the entire process to be restarted.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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