场景
在Ubuntu中重启ssh服务时提示:
Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.
实现
按照提示输入:
systemctl status ssh.service
配置文件有错误导致SSH服务重启失败 ,因为刚修改过配置文件。
配置文件位置:
/etc/ssh/sshd_config
使用
vi /etc/ssh/sshd_config
查看后
可以看到有典型的错误,应该是误操作,将其删掉保存即可。