当前位置:操作系统 > Unix/Linux >>

Job for sshd.service failed because the control process exited with error

在在CentOS7上更改端口号:vi /etc/ssh/sshd_config 保存重启:sudo systemctl restart sshd.service 报错
Job for sshd.service failed because the control process exited with error code.See “systemctl status sshd.service” and “journalctl -xe” for details.
查看SElinux允许的ssh的端口号
$ sudo semanage port -l | grep ssh
ssh_port_t tcp      22
发现SELinux允许的ssh的端口号和ssh配置文件中设置的端口号不一致。
使用semanage工具添加ssh端口号
sudo semanage port -a -t ssh_port_t -p tcp 您的端口
sudo systemctl restart sshd.service
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,