Stable reverse port forwarding in SSH and stale sessions

Posted by Vi on Super User See other posts from Super User or by Vi
Published on 2010-02-19T20:13:41Z Indexed on 2010/03/15 8:50 UTC
Read the original article Hit count: 905

Filed under:
|
|

Using VPS to forward ports behind NAT:

for((;;)) { ssh -R 2222:127.0.0.1:22 [email protected]; sleep 10; }

When connection is broken somehow and it is reconnecting.

Warning: remote port forwarding failed for listen port 2222
Linux vi-server.no-ip.org 2.6.18-92.1.13.el5.028stab059.3 #1 SMP Wed Oct 15 13:33:44 MSD 2008 i686

I type:

vi@vi-server:~$ killall sshd
Connection to vi-server.org closed by remote host.
Connection to vi-server.org closed.
Linux vi-server.no-ip.org 2.6.18-92.1.13.el5.028stab059.3 #1 SMP Wed Oct 15 13:33:44 MSD 2008 i686
vi@vi-server:~$ 

Now it's OK.

How it's simpler to make this automatic?

© Super User or respective owner

Related posts about ssh

Related posts about sshd