首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CentOS7启动SSH服务报:Job for ssh.service failed because the control process exited with error code.......

CentOS7启动SSH服务报:Job for ssh.service failed because the control process exited with error code.......

作者头像
Java学习123
发布2021-12-28 10:00:54
3.4K0
发布2021-12-28 10:00:54
举报
文章被收录于专栏:Java学习123Java学习123

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 写错啦!赶紧改对.....

启动成功!!!!

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档