Hello,
I have a problem with setup of SSH tunneling, I making tunnel in local machine with:
Code:
ssh -v -N -R 2222:localhost:22 user@<public ip>
tunnel looks proper established:
Code:
debug1: remote forward success for: listen 2222, connect localhost:22
I can connect to tunnel using remote machine with localhost:
Code:
nc -zv localhost 2222
Connection to localhost (::1) 2222 port [tcp/*] succeeded!
but cannot using my public ip:
Code:
nc -zv <public ip> 2222
nc: connect to <public ip> port 2222 (tcp) failed: Connection refused
Ports looks open:
Code:
netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2222 0.0.0.0:* LISTEN
tcp6 0 0 ::1:2222 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::21 :::* LISTEN
udp 0 0 127.0.0.53:53 0.0.0.0:*
Code:
lsof -i :2222
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 4847 fjk 7u IPv6 53081 0t0 TCP localhost:2222 (LISTEN)
sshd 4847 fjk 9u IPv4 53082 0t0 TCP localhost:2222 (LISTEN)
I'm also set tcpforwarding in /etc/ssh/sshd_config:
Code:
AllowTcpForwarding yes
What I'm doing wrong?
Rehards.
Bookmarks