我试图隧道通过公共IP到私人服务器的端口80.我知道一个事实,即Apache在端口80上运行,因为如果我ssh进入公共IP我可以通过lynx访问私人服务器就好了。 我正在使用的命令如下:
ssh <remote_public_id> -N -L 9080:<private_ip_of_other_server>:80
然后访问http:// localhost:9080说无法连接。 我正在从OSX这样做。 运行ssh -version我遇到以下情况:
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
按照欧内斯特的要求,这里是一些debugging。 这是我input密码后。 为安全起见删除了IP地址。
debug3: packet_send2: adding 48 (len 63 padlen 17 extra_pad 64) debug2: we sent a password packet, wait for reply debug1: Authentication succeeded (password). debug1: Local connections to LOCALHOST:9080 forwarded to remote address <private_ip>:80 debug3: channel_setup_fwd_listener: type 2 wildcard 0 addr NULL debug1: Local forwarding listening on ::1 port 9080. debug2: fd 4 setting O_NONBLOCK debug3: fd 4 is O_NONBLOCK debug1: channel 0: new [port listener] debug1: Local forwarding listening on 127.0.0.1 port 9080. debug2: fd 5 setting O_NONBLOCK debug3: fd 5 is O_NONBLOCK debug1: channel 1: new [port listener] debug1: Requesting [email protected] debug1: Entering interactive session.
然后当我提出请求时进行debugging:
debug1: channel 3: free: direct-tcpip: listening port 9080 for zmanda port 80, connect from ::1 port 64917, nchannels 5 debug3: channel 3: status: The following connections are open: #2 direct-tcpip: listening port 9080 for zmanda port 80, connect from ::1 port 64912 (t4 r0 i0/0 o0/0 fd 6/6 cfd -1) #3 direct-tcpip: listening port 9080 for zmanda port 80, connect from ::1 port 64917 (t4 r1 i3/0 o3/0 fd 7/7 cfd -1) #4 direct-tcpip: listening port 9080 for zmanda port 80, connect from ::1 port 64918 (t3 r-1 i0/0 o0/0 fd 8/8 cfd -1) debug3: channel 3: close_fds r 7 w 7 e -1 c -1 debug2: channel 4: open confirm rwindow 2097152 rmax 32768 debug2: channel 4: rcvd eof debug2: channel 4: output open -> drain debug2: channel 4: obuf empty debug2: channel 4: close_write debug2: channel 4: output drain -> closed debug2: channel 4: read<=0 rfd 8 len 0 debug2: channel 4: read failed debug2: channel 4: close_read debug2: channel 4: input open -> drain debug2: channel 4: ibuf empty debug2: channel 4: send eof debug2: channel 4: input drain -> closed debug2: channel 4: send close debug3: channel 4: will not send data after close debug2: channel 4: rcvd close debug3: channel 4: will not send data after close debug2: channel 4: is dead debug2: channel 4: garbage collecting debug1: channel 4: free: direct-tcpip: listening port 9080 for zmanda port 80, connect from ::1 port 64918, nchannels 4 debug3: channel 4: status: The following connections are open: #2 direct-tcpip: listening port 9080 for zmanda port 80, connect from ::1 port 64912 (t4 r0 i0/0 o0/0 fd 6/6 cfd -1) #4 direct-tcpip: listening port 9080 for zmanda port 80, connect from ::1 port 64918 (t4 r1 i3/0 o3/0 fd 8/8 cfd -1) debug3: channel 4: close_fds r 8 w 8 e -1 c -1
所以这个问题是一些事情。
最后的命令是这样的:
sudo ssh gdboling@<public_ip> -N -L 443:<private_host>:443