日常错误积累-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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。