问题原文
原帖链接 · aCoolBean · CC BY-SA 3.0
I'm not sure why it isn't starting or why its preventing me from connecting, i get this error:
sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
Active: failed (Result: start-limit) since Wed 2013-09-11 08:45:13 BST; 1min 21s ago
Process: 701 ExecStart=/usr/bin/sshd -D (code=exited, status=1/FAILURE)
Sep 11 08:45:13 alarmpi systemd[1]: sshd.service: main process exited, code=exited, status=1/FAILURE
Sep 11 08:45:13 alarmpi systemd[1]: Unit sshd.service entered failed state.
Sep 11 08:45:13 alarmpi systemd[1]: sshd.service holdoff time over, scheduling restart.
Sep 11 08:45:13 alarmpi systemd[1]: Stopping OpenSSH Daemon...
Sep 11 08:45:13 alarmpi systemd[1]: Starting OpenSSH Daemon...
Sep 11 08:45:13 alarmpi systemd[1]: sshd.service start request repeated too quickly, refusing to start.
Sep 11 08:45:13 alarmpi systemd[1]: Failed to start OpenSSH Daemon.
Sep 11 08:45:13 alarmpi systemd[1]: Unit sshd.service entered failed state.
On the advice of #amrith I ran sshd -t which indicated that the key had not been generate . I generated this using ssh-keygen -A on the advice given in this forum then running systemctl status showed that I am still not running the Daemon. I've attached the error below, sadly I don't know ho Re-running sshd -t gives no messages now.
sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
Active: inactive (dead)
Sep 11 12:04:42 alarmpi systemd[1]: Started OpenSSH Daemon.
Sep 11 12:04:42 alarmpi sshd[289]: fatal: Cannot bind any address.
Sep 11 12:04:42 alarmpi systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a
Sep 11 12:04:42 alarmpi systemd[1]: Unit sshd.service entered failed state.
Sep 11 12:04:42 alarmpi systemd[1]: sshd.service holdoff time over, scheduling restart.
Sep 11 12:04:42 alarmpi systemd[1]: Stopping OpenSSH Daemon...
Sep 11 12:04:42 alarmpi systemd[1]: Starting OpenSSH Daemon...
Sep 11 12:04:42 alarmpi systemd[1]: sshd.service start request repeated too quickly, refusing to start.
Sep 11 12:04:42 alarmpi systemd[1]: Failed to start OpenSSH Daemon.
Sep 11 12:04:42 alarmpi systemd[1]: Unit sshd.service entered failed state.
社区高分解答
原帖链接 · Tommy McNeely · CC BY-SA 3.0
The problem, in our case was that we use a non-standard port for SSH. SELinux can restrict which ports are able to be used by a service. Apparently it gets confused sometimes and forgets that we had allowed that port?
We had to issue the following command to add our port (22222) to the list of available ports
semanage port -a -t ssh_port_t -p tcp 22222
Reference: http://sharadchhetri.com/2014/10/15/centos-7-rhel-7-change-openssh-port-number-selinux-enabled/
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
