Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

It could be a typical port forwarding case, but it is quite confusing for me. I have a machine A which has to connect to C. I can't edit any settings in A, except the destination it has to connect to. It can't connect to C directly due to proxy issue. I want machine B to be setup in such a way that it can listen for an incoming connection from A, and forward to a connection to C. C doesn't like a dedicated connection, so B should establish a connection to C only after A requested one. I can't edit the settings in 'C' either. Any help on how to do this would be great.

share|improve this question
up vote 1 down vote accepted

Is this what you want?

# on b's interface, listen for incoming connections on port 2525
# and forward them to c's localhost on port 25 (assumes b has an interface with
# an ip address of and c is listening for ssh connections on port 
# 25).
user@b$ ssh -L user@c

# on a, ssh to b's interface on port 2525, this will be forwarded
# to c on port 25.
user@a$ ssh -p 2525 user@
share|improve this answer
Thanks for trying to help. No I can't do anything to A, except specifying the actual hostname and port number it can connect to. A has an application with an inbuilt ssh client, which doesn't obey the ssh config settings – user53055 Oct 22 '10 at 13:28

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.