在线咨询
微信咨询
服务热线
服务热线:15639912513
TOP
当前位置:
首页 > 新闻中心> centos课堂>在CentOS8.2上更改端口号时报错:J…

在CentOS8.2上更改端口号时报错:Job for sshd.service failed because the control process exited with error

发布时间:2020-07-24 浏览:13104次

centos8安装完系统后,修改了sshd.config的端口信息,于是执行了systemctl restart sshd.service,可是提示Job for sshd.service failed because the control process exited with error。想了想,估计是sshd.service没启动,查看sshd.service就是没有启动,可是也启动不起来。

1、查看SElinux允许的ssh的端口号

$ sudo semanage port -l | grep ssh

ssh_port_t                     tcp      22

发现SELinux允许的ssh的端口号和ssh配置文件中设置的端口号不一致。

2、解决方法

使用semanage工具添加ssh端口号

sudo semanage port -a -t ssh_port_t -p tcp 588588

3、重启

sudo systemctl restart sshd.service

总结:sudo +systemctl restart sshd.service就可以恢复了。


TAG
13104
该内容对我有帮助