Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm looking to offer a Linux remote support service, to PC's which are mostly behind home NAT routers which don't have any ports forwarded. I want to be able to connect to those PC's by SSH upon request.

I also want to make this a simple as possible to users who probably have no idea how to forward a port on the router.

I'm hoping there is a command that I can give them, which they can paste into a terminal which will connect directly to my machine, setting up a reverse tunnel, through which I can then connect back to their machine via SSH login command.

I'm looking to achieve a command line session, but if I can also have the option to create a remote desktop session instead, that would be a bonus on the occasion that I'm diagnosing a GUI issue.

I have in the past achieved this using a middle machine that is already behind the router and pre-prepared with a reverse tunnel, which is ideal if maintaining a site full of machines, but in this situation, no middle machine or pre-preparation will be available.

Is this possible, or a lost cause?

I note that TeamViewer is able to do exactly what I want, in terms of avoiding port forwarding, but it only gives me a GUI and the most important thing to me is a terminal prompt. Surely, if this is possible for a GUI, this must be a cinch to get just a command prompt?

share|improve this question
    
Is there really a market for a service like this for Linux home users? I am under the impression that anyone running Linux can probably at least handle their own port-forwarding, if not their own tech support entirely. –  mfinni Oct 15 '13 at 0:57
    
It's not those already running Linux that I'm eyeing. It's those which would like to run Linux but can't because there is no support available. –  Peter Snow Oct 15 '13 at 1:37

1 Answer 1

up vote 2 down vote accepted

Yes. Get them to ssh with this command -
ssh -R 2222:127.0.0.1:22 user@youripaddress
Then you can ssh to their machine by sshing to 127.0.0.1 on port 2222 from your local machine.

share|improve this answer
1  
Your solution works, but finding out the own IP is an additional task for the end user. Why not ssh -R 2222:127.0.0.1:22 user@youripaddress ? –  Alojz Janez Oct 15 '13 at 2:16
    
that's possible...never tried that before actually. –  Lawrence Oct 15 '13 at 7:22
    
Yes, using 127.0.0.1 does work. –  Lawrence Oct 16 '13 at 2:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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