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.servicelinux
表示給出的提示很坑爹,徹底不知道哪裏出錯了。
通過艱難的百度,多是SELINUX啓用了,而且SELINUX容許的sshd-port跟設置的port不匹配形成的.ubuntu
1. 查看SeLinux設置的ssh端口
# semanage port -l | grep sshssh
發現端口22222和22是容許被使用的
2.查看 ssh設置的端口
# vi /etc/ssh/sshd_config3d
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 -Tcode
能夠看到,彷佛是sftp組的設置參數彷佛有問題
# vi /etc/ssh/sshd_configblog
使用 : set number顯示行號. 找到第147行it
原來是ForceCommand 寫錯啦!趕忙改對.....社區
啓動成功!!!!百度