ssh 隧道连接在 chromeos 上被拒绝

Posted

技术标签:

【中文标题】ssh 隧道连接在 chromeos 上被拒绝【英文标题】:ssh tunnel connection refused on chromeos 【发布时间】:2019-06-07 03:37:13 【问题描述】:

我正在尝试设置一个 ssh 隧道以在我的本地系统上使用 chrome nodejs 调试器。

我的 nodejs 应用托管在 Google Compute Engine 上。

这些是我在安全外壳应用程序上给出的论点:

-L 9229:localhost:9229

SSH 连接有效,但在填写上面的隧道参数时,我不断收到以下错误消息:

channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused

我尝试在参数中使用 -nN,但这甚至不能完全加载我的命令行。

在 chrome 中,网络目标似乎配置正确。

这些是我得到的详细错误:

channel 2: open failed: connect failed: Connection refused
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: direct-tcpip: listening port 9229 for localhost port 9229, connect from 127.0.0.1 port 65535 to UNKNOWN port 0, nchannels 4
debug3: channel 2: status: The following connections are open:
  #1 client-session (t4 r0 i0/0 o0/0 e[write]/0 fd 102/103/104 sock -1 cc -1)
  #3 direct-tcpip: listening port 9229 for localhost port 9229, connect from 127.0.0.1 port 65535 to UNKNOWN port 0 (t3 nr0 i0/0 o0/0 e[closed]/0 fd 106/106/-1 sock 106 cc -1)

debug3: receive packet: type 92
channel 3: open failed: connect failed: Connection refused
debug2: channel 3: zombie
debug2: channel 3: garbage collecting
debug1: channel 3: free: direct-tcpip: listening port 9229 for localhost port 9229, connect from 127.0.0.1 port 65535 to UNKNOWN port 0, nchannels 3
debug3: channel 3: status: The following connections are open:

我该如何解决这个问题以及频道错误是什么意思。

如果我将端口更改为例如-L 9221:localhost:9229 并将 localhost:9221 添加到 chrome 目标发现设置我可以在其他端口上重现错误。

【问题讨论】:

你是如何启动节点的? @mscdex 在 ssh 连接后手动。我只有一个要测试的简单脚本。我只能调试服务器吗? ***.com/a/27879297/13317 @Christoph 如何而不是何时 @mscdex node --inspect test.js 【参考方案1】:

解决了我需要使用 --inspect-brk 添加断点,这样代码就不会完全触发。

我还需要打开 2 个 ssh 会话。一个用于端口转发,一个用于编码。

【讨论】:

以上是关于ssh 隧道连接在 chromeos 上被拒绝的主要内容,如果未能解决你的问题,请参考以下文章

SSH 连接隧道被拒绝

SSH 公钥在“git clone”命令上被拒绝

具有崇高和 ssh 连接拒绝的 rsub

Laravel Valet 站点连接在端口 80 上被拒绝

Moqui 连接在 Nginx 后面的 HTTPS 上被拒绝

SSH 到防火墙后面的服务器