ISPs in PK don’t generally allow incoming traffic to your public IP rendering it useless, this is a real pain , when you want to access your machine from a remote location. The solution to it is a reverse ssh tunnel, which will work in the following way

[Home Machine] ==> {Middle Machine} ==> {You}

So you’ll map a port from your home machine to your middle machine , which when connected to from the middle machine will forward all traffic to your home machine. I’ll give an example on howto acheieve it.

On home machine , do this

user@home$ ssh -N -f -R 2222:localhost:22 user@middle-machine

Enter the password for your middle machine and that’s it.

Now you can con

nect to the middle machine from any where in the world and do

user@middle-machine$ ssh user@localhost -p 2222

and it will forward it to the ssh server running on your home machine.

Oh btw, you’ll need to change the following in /etc/ssh/sshd_config

TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 99999

Have fun 🙂

Reverse SSH Tunnel

3 thoughts on “Reverse SSH Tunnel

  • August 27, 2008 at 12:16 pm
    Permalink

    where do these settings apply

    Reply
  • September 20, 2008 at 6:46 pm
    Permalink

    where do these settings apply

    Reply
  • September 20, 2008 at 6:47 pm
    Permalink

    where do these settings apply
    i have cpei 300 Wolverine

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.