First of all, I am not a Linux or ssh newbie. I have searched for this problem on many forums extensively but nobody seemed to have discussed this. Please help me!

I live in a student dorm (off-campus) and all students of the dorm share the same WAN IP (Internet or public IP), which is fortunately static. I am not an admin and have no control over the router that assigns private IP's to all of the students, so I can't really forward port 22 to my computer :( Is it still possible to establish an ssh connection to my dorm computer from a computer on campus?

link|improve this question
feedback

migrated from stackoverflow.com Dec 19 '09 at 3:04

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 11 down vote accepted

If you have access to another Linux box, out on the Internet, then you can connect from your dorm to it, and set up a reverse ssh tunnel. Then, when you leave your dorm, connect to that box and tunnel back through to your dorm machine.

You might need a cheap shell account somewhere, or get a friend to hook you up with an account on their box. Or maybe you have a shell account with your school that you can use for this.

In order to keep the ssh tunnel alive, refer to this question.

link|improve this answer
feedback

The real answer is to ask the local network administrators for help, rather than attempting to work around the restrictions that they have placed on the network.

link|improve this answer
3  
He's not circumventing a security restriction, and I think that realistically finding the right person to talk to at a university is going to be just as unlikely as them being willing to change network settings for you. By solving the problem yourself, everybody wins. – RJFalconer Dec 28 '09 at 21:58
1  
Actually I recently found somewhere in the obscure documentation of my dorm network that each each student is assigned a port from higher ports for the ssh-server. So I run the ssh-daemon on my laptop and make it listen to that port instead of 22. Problem solved!! :) – Aamir Jan 8 '10 at 15:58
feedback

If you don't have control over the "router" (really a NAT box), then if it's setup to respect UPnP requests, perhaps you can use that to tell it to open an incoming port for you.

Otherwise you'll have to tunnel in from some other machine with a real IP somewhere.

link|improve this answer
feedback
  1. Run a sshd server on your home computer

  2. If you have a dynamic IP address at home (DSL etc), use a free service such as DynDNS to bind your IP address to a known domain name. DynDNS will assign you a domain name such as aamir.homeip.net

  3. If you have a router/firewall at home (you usually need one if you have more than one computer or a wireless network), make sure it routes ssh connections to your home computer (i.e., forwards communications on port 22 to your computer's port 22 - check out "port forwarding").

  4. From your dorm, type "ssh mydomainname.homeip.net".

Good luck!

link|improve this answer
1  
Sorry if I wasn't being clear. Actually my dorm is my home :) I have edited the question. – Aamir Dec 19 '09 at 3:02
Thanks for your answer but I already knew this whole process. My question is what if I don't have control over the router and still want to ssh into the computer behind router from outside. Hope I am clear now. – Aamir Dec 19 '09 at 3:17
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.