No Account Yet?

You are not logged in.

Add to: JBookmarks Add to: Facebook Add to: Windows Live Add to: Digg Add to: Del.icoi.us Add to: Reddit Add to: StumbleUpon Add to: Slashdot Add to: Netscape Add to: Furl Add to: Yahoo Add to: Blogmarks Add to: Technorati Add to: Newsvine Add to: Google Information
How to setup a reverse ssh tunnel E-mail
Linux HowTo's - Advance Linux HowTo's
Written by Allen Sanabria   
Sunday, 10 February 2008 00:30

Ever wanted to know how you can ssh into your work desktop/server? Well do not worry any longer.....

    • All you need to do is create a reverse tunnel from your Work Desktop/Server to your home server.

    • ssh -nNT -R 5000:local_server:22 username@remote_server
    • Now from the remote_server run this
      ssh -p5000 localhost.... now we are in our work desktop/server.
    • Lets brake this down a bit..

    • The -n option Redirects stdin from /dev/null. This must be used when ssh is run in the background.
    • The -N option does not execute a remote command. This is useful for just forwarding ports.
    • The -T option disables pseudo-tty allocation.
    • The -R option does tha job of setting up the reverse tunnel.
    • Port 5000 is the port that will be listening on the remote_server (this can be any random port over 1024, if you want to run this as a non-root user).
    • local_server is the desktop/server that you are creating the connection from.
    • Port 22 is the port that you are making the ssh connection to.
    • user_name@remote_server is where you are making the ssh connection to for the reverse tunnel.
    • We need to make sure we keep this connection open.
    • In /etc/ssh/sshd_config we need to make sure this is set TCPKeepAlive yes.
Comments
Search RSS
Only registered users can write comments!

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Wednesday, 14 May 2008 11:55 )