-1

机器 A 和 B 正在尝试连接到机器 C。

A到达那里。当我执行 ssh -v ip 时,我得到:

OpenSSH_5.1p1, OpenSSL 0.9.8j-fips 07 Jan 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to C.server.ip.addy [C.server.ip.addy] port 22.
debug1: fd 3 clearing O_NONBLOCK

然后还有更多不重要的调试。

B 无法到达那里。当我执行 ssh -v ip 时,我得到:

OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to C.server.ip.addy [C.server.ip.addy] port 22.
debug1: connect to address C.server.ip.addy port 22: Connection timed out
ssh: connect to host C.server.ip.addy port 22: Connection timed out

永远达不到的线是:

debug1: fd 3 clearing O_NONBLOCK

什么会导致这个?请帮忙!

4

2 回答 2

0

One possible cause may be a Firewall misconfiguration (A=>C on port 443 allowed, B=>C = denied).

In any case, if you have access to the C machine, put a packet sniffer like WireShark and check if the packets originating from B are actually reaching the machine.

于 2013-08-20T23:29:06.517 回答
0

我可以想到可能导致这种情况的几件事。

  1. B->C 之间的防火墙可能会阻止连接。这些机器是否在同一个子网上?有防火墙吗?这样的规则可能允许您连接 C->B。您可以使用 scp 将文件拉到这个方向。就像是

    C$ scp user@B:/path/to/file /local/path/to/file

  2. tcpwrapper 规则可能具有类似的效果。/etc/hosts.deny 中是否有阻止来自机器 B 的 SSH 的规则?查看 hosts.allow 和 hosts.deny 的手册页以获取有关更改 tcpwrapper 规则的信息。

您应该使用 nmap 来检查哪些端口是开放的,并且可以从 B 和 A 访问。类似下面的内容应该可以为您提供一些有用的信息。如果端口 22 从 A 而不是 B 打开,则上述之一可能会阻塞它。

nmap -T4 -A -P0 -p0-65535 C
于 2013-08-20T23:41:25.077 回答