Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a service running on a certain port at the server. What I want to do is, access the server using SSH and use a local (client-side) program to access the server's port. Is that possible?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Connecting to a port on a server via an ssh tunnel can be done with the -L local port forwarding option.

For example, to connect to www.example.com:80 & to make it available on the client as port 8080, you would do:

ssh -L8080:127.0.0.1:80 www.example.com

This allows you to go to http://127.0.0.1:8080 in your browser & have www.example.com:80 available. You can also have www.example.com connect to another host instead of itself, making the tunnel into a proxy.

share|improve this answer

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.