【发布时间】:2017-08-24 12:33:39
【问题描述】:
我有一个位于专用网络中的虚拟机。
所以首先,我应该进来server.com,然后进来my-machine。
我想将笔记本电脑上的ssh-tunnel 转换为my-machine。
ssh -v -A -nNT -L 40000:127.0.0.1:40000 login@server.com ssh -v -nNT -L 40000:127.0.0.1:40000 my-machine &
现在我想用netcat 测试ssh-tunnel。
我在my-machine运行:
nc -l 40000
在我的笔记本电脑上:
~ ❯❯❯ nc 127.0.0.1 40000
但它给了我:
debug1: Connection to port 40000 forwarding to 127.0.0.1 port 40000 requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug1: channel 2: free: direct-tcpip: listening port 40000 for 127.0.0.1 port 40000, connect from 127.0.0.1 port 49692 to 127.0.0.1 port 40000, nchannels 3
为什么会发生这种情况以及如何解决?我希望我在笔记本电脑控制台中输入的任何内容都会出现在my-machine 控制台中。
最后一个字符串是什么意思?特别是127.0.0.1 port 49692为什么要用这个端口?我从不打字。
debug1: channel 2: free: direct-tcpip: listening port 40000 for 127.0.0.1 port 40000, connect from 127.0.0.1 port 49692 to 127.0.0.1 port 40000, nchannels 3
【问题讨论】:
标签: networking ssh netcat ssh-tunnel