发布网友 发布时间:2022-04-23 02:25
共1个回答
热心网友 时间:2023-08-04 07:02
你连接使用的用户名和密码以及端口号是否正确。
A服务器sshd服务重启不了,总是stop failed。start正确。A服务器上能连接上其他ssh服务器,但是其他机器不能连接到A的ssh服务。
[root@localhost ~]# /etc/init.d/sshd restart
[root@localhost ~]# cat /proc/version
Linux version 2.6.18-1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Thu Sep 3 03:28:30 EDT 2009
检查日志(/var/log/secure 文件)发现如下错误提示:
Nov 14 12:10:41 localhost sshd[31842]: fatal: Cannot bind any address.
Nov 14 12:11:18 localhost sshd[31996]: fatal: Cannot bind any address.
Nov 14 12:11:20 localhost sshd[32016]: fatal: Cannot bind any address.
Nov 14 12:15:52 localhost sshd[32320]: fatal: Cannot bind any address.
Nov 14 12:17:18 localhost sshd[32527]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Nov 14 12:17:18 localhost sshd[32527]: fatal: Cannot bind any address.
Nov 14 12:17:19 localhost sshd[32538]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Nov 14 12:17:19 localhost sshd[32538]: fatal: Cannot bind any address.
提示显示端口22被占用,绑定失败。
在网上可以找到类似的案例,一般的解释是ipv4与ipv6启动冲突。