0

我正在尝试与另一台机器建立 ssh 连接,该机器的端口已被其他资源占用

SSH 没有超时

> ssh -v -p 8080 10.10.10.10
OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 10.10.10.10 [ 10.10.10.10 ]
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established
debug1: identify file /home/abc/.ssh/identity type -1
debug1: identify file /home/abc/.ssh/id_rsa type -1
debug1: identify file /home/abc/.ssh/id_dsa type 2
debug1: ssh_exchange_identification :
debug1: ssh_exchange_identification : \022\\[
debug1: ssh_exchange_identification : \022\\Z
debug1: ssh_exchange_identification : \022\\[
debug1: ssh_exchange_identification : \022\\Z
debug1: ssh_exchange_identification : \022\\[

机器 10.10.10.10 已启动并正常运行。8080 端口已被其他资源占用。以上日志没有结束。它没有超时。

我尝试使用参数 ConnectTimeout 添加,但行为没有变化。

我期待一些消息

ssh -v -p 77 10.10.10.10

OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 10.10.10.10 [ 10.10.10.10 ] port 77.
debug1: connect to address 10.10.10.10 port 77 : Connection refused
>

为什么SSH的这种行为。请帮忙 ..

4

1 回答 1

1

Connection refused只有当没有程序在端口 77 上监听时,您才会明白这一点。监听该端口的程序正在等待连接,但它无法理解 ssh 正在发送什么(即 ssh 协议)。

于 2012-07-05T06:46:16.823 回答