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 have a local machine which has SSH access to Server1. Server1 has access to Server2 with Tomcat running on port 5050. How can I can connect to that Tomcat on port 5050 on my local machine in the browser?

share|improve this question
up vote 7 down vote accepted
ssh -L <localport>:<server2>:<server2-port> user@host

Example: ssh -L user@host

Add -f to let the ssh session run in the background.

Add -g to let other hosts connect to server1s locally forwarded port.

share|improve this answer
Thanks, you saved my life. – IgorDiy Mar 22 '12 at 7:11

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.