Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a computer at home (home-server) that runs irssi, rtorrent etc. My ISP is blocking every traffic from outside (dumb, I know, but it's the only ISP I can have).

I want to be able to log in into home-server's shell from any remote-computer (behind NAT).

I've got shell account somewhere (without root access), that may be some use to that.

Here's diagram describing situation: enter image description here

Is this possible to gain access to shell on my home-server? I heard something about ssh tunneling, but I couldn't find any tutorial matching this case.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

on Home server (tunnel from third party to home):
ssh -R 20000:127.0.0.1:22 thirdparty.org

This connects your home box to the third party shell, and then starts to forward any connections to port 20000 on the third party shell to port 22 on your home box (the SSH port).

On remote computer (tunnel from remote to third party):
ssh -L 20000:127.0.0.1:20000 thirdparty.org

This connections your remote box to the third party shell, and then starts to foward port 20000 on the remote box to port 20000 on the third party shell.

and then on remote computer (connect over tunnels):
ssh 127.0.0.1:20000 and enter in credentials for your home server

This will attempt to ssh to port 20000 on the remote box. Since we set up a tunnel to the third party, the #2 command effectively forwards this connection attempt to 127.0.0.1:20000 on the third party shell. Then, the first command fowards the connection again to port 22 on your home box, at which point the ssh server picks up the connection.

share|improve this answer
    
Could you explain what's going on there? –  seler Jul 26 '11 at 22:40
    
after ssh 127.0.0.1 -p 20000 it worked. Still, if you could please explain this... –  seler Jul 26 '11 at 22:53
1  
He is setting up two really basic VPNs to the relay box. You might want to look at using something like autossh on your home box to make sure the tunnel stays up, and is automatically started. –  Zoredache Jul 26 '11 at 22:54
1  
@seler I added some detail, please let me know if you need more explanation :) –  Darth Android Jul 27 '11 at 13:57
    
Stupid simple! Thank you! –  seler Jul 27 '11 at 19:07

Or you might as well setup some IPv6 tunnels with HE.net and just connect directly... (Many VPN solutions will work as well.)

share|improve this answer

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.