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

1 Answer

up vote 7 down vote accepted
ssh -L <localport>:<server2>:<server2-port> user@host

Example: ssh -L 5050:server2.company.com:5050 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
add comment

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.