solaris ssh端口转发

我一直试图在Linux机器上使用ssh -i <some_private_key_file> -L 3333:localhost:3306 root@<Solaris box>命令在ssh -i <some_private_key_file> -L 3333:localhost:3306 root@<Solaris box>上创build一个从Linux机箱到mysql服务器的ssh隧道。

在尝试从命令mysql -P 3333 -h 127.0.0.1 -u root -p从Linux机器连接到mysql服务器时,出现以下错误: ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

现在在debugging级别3上运行sshd(Solaris),我得到以下错误:

 debug1: server_input_channel_open: ctype direct-tcpip rchan 3 win 2097152 max 32768 debug1: server_request_direct_tcpip: originator 127.0.0.1 port 34100, target localhost port 3306 Received request to connect to host localhost port 3306, but the request was denied. debug1: server_input_channel_open: failure direct-tcpip 

并且还得到以下错误: channel 3: open failed: administratively prohibited: open failed

在Solaris机器上:

  • SSH版本:Sun_SSH_1.1
  • cat / etc / release:Solaris 10 11/06 s10x_u3wos_10 X86
  • uanme -a:SunOS不详5.10 Generic_118855-33 i86pc i386 i86pc

在Linix盒子上:

  • SSH版本:OpenSSH_5.3p1,OpenSSL 1.0.0-fips 2010年3月29日

修正:在sshd_config中有两个冲突的AllowTcpForwarding值。 不知何故,第一个价值为no优先。 可能是OpenSSH 4.2p1的一个bug