【发布时间】:2015-12-02 03:24:40
【问题描述】:
我可以通过 ssh 进入服务器,例如端口 22 上的 abc.xyz,但我无法在 Eclipse 中远程调试它。这是附加信息:
服务器启动参数 -
-Xdebug -Xrunjdwp:transport=dt_socket,address=1234,server=y,suspend=n
来自日志的确认 -
Listening for transport dt_socket at address: 1234
当我在本地系统上远程登录时 -
local-machine% telnet abc-xyz 1234
Trying xx.xx.xx.xx...
telnet: connect to address xx.xx.xx.xx: Connection timed out
telnet: Unable to connect to remote host: Connection timed out
当我在服务器上 telnet(abc.xyz) -
abc-xyz% telnet localhost 1234
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.
我尝试通过 -
设置隧道ssh -L 1234:localhost:1234 user@abc-xyzssh -L 1234:127.0.0.1:1234 user@abc-xyz
我正在使用这个配置在 Eclipse 中附加调试器 -
Connection type - Standard (Socket attach)
Host - localhost
Port - 1234
无法让 Eclipse 附加到 1234。
设置 SSH 隧道后,如果我手动尝试连接到端口,我会收到此响应 -
local-machine% telnet localhost 1234
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.
我在 catalina.out 中看到一个条目:
通道 4:打开失败:连接失败:连接被拒绝
任何帮助将不胜感激。
编辑 - 1:
我跑了
abc-xyz% ~#
得到以下输出:
The following connections are open:
#2 client-session (t4 r0 i0/0 o0/0 fd 7/8 cc -1)
#3 direct-tcpip: listening port 1234 for localhost port 1234, connect from 127.0.0.1 port 23456 (t4 r1 i0/0 o0/0 fd 10/10 cc -1)
我认为 ssh 隧道正在工作,只是我与 Eclipse 连接的方式在这里出错了。
【问题讨论】:
标签: eclipse remote-debugging ssh-tunnel