我是网络相关领域的新手,我想通过另一台服务器(隧道)访问远程客户端,例如远程客户端 11.11.111.111 ,用户名和密码为 user2 ,密码为 2 ,通过 11.11.10.01 的隧道,用户名和密码为 user1 ,密码为 1
我可以成功 ping 地址隧道地址。但是当我尝试使用 cygwin 访问远程客户端时:
ssh -vv -o 'ProxyCommand ssh -vv [email protected] nc %h %p' [email protected]
我收到此错误:
OpenSSH_6.4, OpenSSL 1.0.1f 6 Jan 2014
debug2: ssh_connect: needpriv 0
debug1: Executing proxy command: exec ssh -vv [email protected] nc 11.11.111.111 22
debug1: permanently_drop_suid: 146765
debug1: identity file /home/user1/.ssh/id_rsa type -1
debug1: identity file /home/user1/.ssh/id_rsa-cert type -1
debug1: identity file /home/user1/.ssh/id_dsa type -1
debug1: identity file /home/user1/.ssh/id_dsa-cert type -1
debug1: identity file /home/user1/.ssh/id_ecdsa type -1
debug1: identity file /home/user1/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.4
OpenSSH_6.4, OpenSSL 1.0.1f 6 Jan 2014
debug2: ssh_connect: needpriv 0
debug1: Connecting to 11.11.10.01 [11.11.10.01] port 22.
debug1: connect to address 11.11.10.01 port 22: Connection timed out
ssh: connect to host 11.11.10.01 port 22: Connection timed out
ssh_exchange_identification: Connection closed by remote host
我的命令正确吗?对可能的原因有什么想法吗?
有什么方法可以排除故障(最好在我的计算机上而不是在服务器和远程客户端上)?
答案1
我相信这只是部分答案,但请尝试使用 ssh 连接到 11.11.10.01:
ssh [email protected] -L20022:11.11.111.111:22
然后在另一个窗口中通过以下方式连接:
ssh [email protected] -p20022
这样,您将在第一个终端窗口中看到错误。