Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 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

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


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.