SSH tunnel question

Thomas Charron twaffle at gmail.com
Wed Feb 27 12:07:28 EST 2008


On Wed, Feb 27, 2008 at 11:56 AM, Steven W. Orr <steveo at syslang.net> wrote:
> Sometimes I just get lucky here. :-)
>  I go to work every day and I log into my linux computer at home from my
>  linux desktop at work. I use ssh and everything works just fine. My
>  computer at home is on the net on a public address so I have no visibility
>  problems. But because of lots of things, Nat is not the least of them, I
>  don't see my work 'puter from home.
>  I'd like to establish a tunnel from work to home so that if I wanted to I
>  can then get access from home. I'm thinking that ssh has this capability
>  but i never learned how to do it. Does anyone know how to do this? Or is
>  there a better way besides ssh?

  The simplest way is to pass the ssh param -R and forward a remote
port of your home computer to a local port (22) on your work computer.
 While ssh is connected, it will forward any given ports to any given
ports, and this would allow the ssh connection to say 'MyHomePC Port
9876 should be forwarded to MyWorkPC Port 22'.  You could then ssh
from home INTO your home PC using a different ssh port, and magically
have it appear as an ssh to your work computer.

  All of this will only work while the ssh from work to home is open, however.

  Depending on your work environment, you may not want to be caught
doing this.  In many cases, if you are, some could consider it grounds
for termination.

-- 
-- Thomas


More information about the gnhlug-discuss mailing list