编辑/etc/ssh/sshd_config文件,修改sshd端口后,systemctl restart sshd重启sshd报错:
-- Unit sshd.service has begun starting up.
5月 13 00:32:53 localhost.localdomAIn sshd[2153]: error: Bind to port 11 on 0.0.0.0 failed: Permission denied.
5月 13 00:32:53 localhost.localdomain sshd[2153]: error: Bind to port 11 on :: failed: Permission denied.
5月 13 00:32:53 localhost.localdomain sshd[2153]: fatal: Cannot bind any address.
5月 13 00:32:53 localhost.localdomain systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
5月 13 00:32:53 localhost.localdomain systemd[1]: Failed to start OpenSSH server daemon.
解决方法:这是没有关闭selinux导致的,关闭selinux后正常
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl restart sshd
[root@localhost ~]# systemctl status sshd