I need to ssh into my work computer, and then I need to connect to an external website (hosted entirely at another company) that my work has contracted with using my work machine.

This answer says I can tunnel through a single port using:

ssh -L 8080:server-hostname:80 remote-host

Which is ideal because then I don't have to pipe my entire traffic to my work machine. So if the website I need to access with my work machine is at:


I tried:

ssh -L 8080:http://www.abcde.com/1020-39x/proprietary-documentation-blah:80 me@work

But command returns an error saying Bad local forwarding specification

How can I do this?

  • Do you want to get to the website entirely by ssh, or would using a web browser be an option? You can set, for example, Firefox to use an ssh tunnel. – mikewhatever Oct 5 '15 at 18:41

You need to do it this way:

ssh -L 8080:www.abcde.com:80 me@work

and then connect with your browser to:


to get the content of your remote server on www.abcde.com.

  • The content is hosted at the client site, which is not part of the internal corporate network. So basically, I'm asking how I can ssh into my corporate machine, then browse to the www.abcd.com/... as though I was sitting at my desk and using my web browser on my work machine. I think your answer assumes that the content is hosted directly on the corporate servers, because I'm getting 'the requested URL is invalid` when I try it. – bime Oct 5 '15 at 23:52
  • so for this would be better to use dynamic forwarding (aka SOCKS proxy): ssh -D 9999 me@work and then set up your browser to pass data over this proxy, which would allow you to connect directly to the website using the same URL. – Jakuje Oct 6 '15 at 12:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.