日常错误积累-01-ssh重启报错或者无法重启-Failed to restart ssh.service: Unit not found

1.在修改了sshd_config文件之后需要重启sshd,准备执行一下命令进行重启:

/etc/init.d/ssh restart

2.发现这个路劲底下根本没有ssh,尝试以下命令:

# sudo service ssh restart
Redirecting to /bin/systemctl restart ssh.service
Failed to restart ssh.service: Unit not found.

出现以下错误

Failed to restart ssh.service: Unit not found.

3.原因:以上命令都是centos6里面的命令,在centos7需要用:

systemctl restart sshd
    原文作者:Jayce_xi
    原文地址: https://www.jianshu.com/p/a5f9e900136a
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞