My home PC is behind NAT but my router has static ip address. My work PC uses 3G stick for Internet (So I guess it is like being behind NAT).
I would like to create a reverse SSH-tunnel to connect to my work PC. Following lots of manuals I create a tunnel on my work PC:
ssh -R 33333:localhost:22 [email protected]
22.214.171.124 is my router's static IP address.
When trying to connect to work from home I isssue:
ssh -p 33333 localhost
But I get "connection refused". I think I need to configure some port forwarding because I think I need to somehow make ssh let me connect some local port to my router's 33333 port to make the tunnel work. How do I do it?
Output at my work PC:
netstat -nap --inet --tcp Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:56789 0.0.0.0:* LISTEN 1402/klient tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 10.0.85.14:56731 126.96.36.199:443 ESTABLISHED 1402/klient tcp 0 1 10.0.85.14:52501 188.8.131.52:22 SYN_SENT 2366/ssh tcp 0 0 10.0.85.14:56789 184.108.40.206:53633 ESTABLISHED 1402/klient tcp 0 0 10.0.85.14:47118 220.127.116.11:443 ESTABLISHED 1402/klient
netstat - output at my works PC:
Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 10.0.85.14:56731 18.104.22.168:https ESTABLISHED tcp 0 1 10.0.85.14:52501 22.214.171.124:ssh SYN_SENT tcp 0 0 10.0.85.14:56789 ec2-52-49-10-125.:53633 ESTABLISHED tcp 0 0 10.0.85.14:47118 126.96.36.199:https ESTABLISHED