CentOS7啟動SSH服務報:Job for ssh.service failed because the control process exited with error code..........
宇智波唐嫣 2019-04-18 12:07:00 1384 收藏 1
版權
面試:你懂什么是分布式系統嗎?Redis分布式鎖都不會?>>>
CentOS7啟動SSH服務報:
Job for ssh.service failed because the control process exited with error codesee systemctl status ssh.service and journalctl -xe for details.
然后按照提示輸入: systemctl status sshd.service
表示給出的提示很坑爹,完全不知道哪里出錯了。
經過艱難的百度,可能是SELINUX啟用了,並且SELINUX允許的sshd-port跟設置的port不匹配造成的.
1. 查看SeLinux設置的ssh端口
# semanage port -l | grep ssh
發現端口22222和22是允許被使用的
2.查看 ssh設置的端口
# vi /etc/ssh/sshd_config
ssh使用的是默認端口22,與selinux是匹配的。不是這個錯。繼續百度......
終於在ubuntu社區看到一篇帖子:
run sudo /usr/sbin/sshd -T to see what is wrong with the service and why does it fail.
# /usr/sbin/sshd -T
可以看到,似乎是sftp組的設置參數似乎有問題
# vi /etc/ssh/sshd_config
使用 : set number顯示行號. 找到第147行
原來是ForceCommand 寫錯啦!趕緊改對.....
啟動成功!!!!
————————————————
版權聲明:本文為CSDN博主「宇智波唐嫣」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/wxmiy/java/article/details/89740592