Page 1 of 1

Connecting computers in reverse with SSH

PostPosted: Tue Feb 03, 2009 3:28 pm
by stack
Hello everyone!

[EDIT] Not my original post.

So my sister uses Ubuntu for all of her school work at her University several states away. She recently had a problem that I needed to log into her computer to fix. However, her school wouldn't allow me to connect to her computer but she could connect to mine. For ease of explanation I am going to call my system Debian (cause that is what I run).

The 2 Linux boxes are connected in such a manner.
Debian<---->Internet<---->Firewall<--->Ubuntu.

I have Zero-Zip-None control over the University Firewall.

At first I was trying a few different things and was getting a bit frustrated. So I made a post to ask for help and then I sat back in my chair hoping someone could help. About 20 seconds later it hit me like a ton of bricks*.

Now I am posting for anyone else who might find this handy in the future.

On the remote system (Ubuntu in this example) run:
Code: Select all
ssh -R 1100:localhost:22 user@ubuntu.yourschool.org


Obviously change the user@ubuntu.yourschool.org to meet your needs. I have to add the port flag because my network requires I access it via port 443 (-p443).

Once established the local system (Debian) can then run:
Code: Select all
ssh -p1100 user@localhost


Tada!! I have a SSH connection from the Debian box to the Ubuntu box!

I *heart* SSH
~S~

*So the example I found on Google recommended doing:
Code: Select all
ssh -R 1100:localhost:1100

I don't know why, but it just didn't strike me as unusual. However, it kept failing. The reason why it kept failing is because I was trying to establish an SSH connection back to the original host on port 1100. SSH doesn't run on port 1100 (without modifications), it runs on port 22. Made that one (_1_!!) change and it all works now. :oops:

Re: Connecting computers in reverse with SSH

PostPosted: Wed Feb 04, 2009 8:51 am
by maczimus
Found this yesterday as well. seems pretty useful although i haven't had the chance to try it yet.

https://launchpad.net/remote-help-assistant

Re: Connecting computers in reverse with SSH

PostPosted: Wed Feb 04, 2009 10:59 am
by stack
Sweet! This looks pretty cool; Thanks!

For my purposes, SSH works well because I only need a command prompt. However, I can completely see the use in this.

Re: Connecting computers in reverse with SSH

PostPosted: Wed Feb 04, 2009 8:53 pm
by David Miller
ssh over an ssh tunnel, i like it.

I remember one time I was at school and I used a java ssh app on the lab computer to tunnel to a port on my computer at home. ssh tunneling can be very useful. The java app was called mindterm and it might come in handy if you ever want to do tunneling on machines without ssh already installed, ie windows machines.