与主通道的SSH端口转发

我试图在现有的主频道上设置一个反向端口,但似乎没有工作,我不知道为什么。 我这样设置主频道:

ssh -MN -oControlPath=/tmp/mycontrolpath hostname 

我试图像这样打开一个反向端口:

 ssh -oControlPath=/tmp/mycontrolpath -NR 10017:127.0.0.1:10017 hostname 

但是这第二个进程失败,输出

 stdin: is not a tty 

并且远程主机上没有打开端口转发。 这似乎是该协议的一个支持function(无论如何,根据RFC),但我无法快速尝试使用它。 有没有人得到这个工作?

客户端SSH版本是OpenSSH_5.3p1 Debian-3ubuntu6,OpenSSL 0.9.8k 2009年3月25日,在服务器上连接到OpenSSH_5.5p1 Debian-6,OpenSSL 0.9.8o 2010年6月1日。

UPDATE

使用-vvvv运行端口转发命令会提供以下输出:

 OpenSSH_5.3p1 Debian-3ubuntu6, OpenSSL 0.9.8k 25 Mar 2009 debug1: Reading configuration data /home/regularfry/.ssh/config debug1: Applying options for * debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering stdin: is not a tty 

主套接字进程的相应输出的相关部分如下所示:

 debug3: fd 5 is not O_NONBLOCK debug3: ssh_msg_recv entering debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: muxserver_accept_control: receiving 2 env vars debug2: muxserver_accept_control: accepted tty 0, subsys 0, cmd debug2: muxserver_accept_control: got fds stdin 6, stdout 7, stderr 8 debug3: ssh_msg_send: type 2 debug2: fd 5 setting O_NONBLOCK debug1: channel 0: new [client-session] debug3: muxserver_accept_control: channel_new: 0 debug2: channel 0: send open debug3: Wrote 64 bytes for a total of 2679 debug2: callback start debug2: client_session2_setup: id 0 debug1: Sending environment. debug1: Sending env LANG = en_GB.UTF-8 debug2: channel 0: request env confirm 0 debug1: Sending env LC_CTYPE = en_US.UTF-8 debug2: channel 0: request env confirm 0 debug2: channel 0: request shell confirm 1 debug2: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug3: Wrote 192 bytes for a total of 2871 debug2: channel 0: rcvd adjust 2097152 debug2: channel_input_status_confirm: type 99 id 0 debug2: shell request accepted on channel 0 debug2: channel 0: rcvd ext data 20 debug2: channel 0: written 20 to efd 8 

你的确切的例子工作得很好,服务器OpenSSH_5.5p1 Debian-4和客户端OpenSSH_5.8p1 Debian-4 。 所以我会build议如果可能的话升级你的客户端。

编辑:它也可以倒转客户端和服务器(我实际上这样创build一个redirect循环),所以它可能足以达到5.5p1的客户端。