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 am new to this forum and to this kind of stuff so don't judge me hard:

I would like to connect with: sftp client (Bitise Tunneler) and nxClient (NOMACHINE) to the server A through other server B. Because server B is reachable from my computer and A is not.

I understood that I need some kind of tunneling. But don't know how to do it.

Thanks a lot.

share|improve this question

1 Answer 1

The following SSH config in ~/.ssh/config allows you to easily setup tunnels. It requires nc to be installed on the intermediate host.

Host *%*
    ProxyCommand ssh $(echo %h | cut -d%% -f2-) nc $(echo %h | cut -d%% -f1) %p

Running ssh host1.example.com%host2.example.com will SSH to host1 via host2. I don't know whether your SFTP client will use this configuration though. In that case you can manually setup a tunnel for it to use with something like the following:

ssh -fNL 10022:host1.example.com:22 host2.example.com

and then configure the SFTP client to connect to localhost:10022.

share|improve this answer
    
nice config example! I am sure I will find a use for that. –  MountainX Jul 11 '13 at 2:48

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.