This howto is useful to help your friend or coworker when they are having problem but you cant help by ssh to their box because of firewall or there is no way in.

First,ask them to ssh to your box or any outside server that you have permission to use. The below command will do. You can use any available free port.

#ssh -R port:localhost:22 user@public_server.com

Example

#ssh -R 22222:localhost:22 patin@sukida.net

Then edit your ssh config file. Make an entry for the server that you want to access.

#vim ~/.ssh/config
Host patin.localdomain
HostName localhost
HostKeyAlias patin.localdomain
CheckHostIp no
Port 22222

Now you are done. It’s quite simple actually. All you need to know is what port he/she using to mapping to the ssh port.