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