我一直试图在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机器上:
在Linix盒子上:
修正:在sshd_config中有两个冲突的AllowTcpForwarding值。 不知何故,第一个价值为no优先。 可能是OpenSSH 4.2p1的一个bug