I'm browsing the web on a client PC running Windows or Linux. I want to browse a website (http://access.lan:52050//cgi-bin/login.cgi) which is not directly accessible from my PC.

  • I can browse the website if I go through a proxy machine. Its IP address is It's running Red Hat Linux.
  • I can log in to the Red Hat machine from my client PC with SSH version 1.

How can I set this up in a simple way?

  • I think that I understand your question, but it was very difficult. Please check that my rewording has kept the meaning you intended. Please, make an effort to write understandable English, even if English is not your native language (it isn't mine either). – Gilles 'SO- stop being evil' Jan 11 '12 at 1:39
  • yes, re-wording is fine - sorry – Tony Jan 11 '12 at 2:20

You can use ssh tunneling to access the website. Since the PC with ip has the access to the website, you can make to ask the website on your behalf. All the requests sent by you will first be sent to the in a ssh tunnel.

You have to use the following command:

$ ssh -N -L your-port:access.lan:52050 user-name@


1. your-port: Port > 1024 which you will make as your end of tunnel.    
2. user-name: login name of the user on whose passwd you know.
|improve this answer|||||

From a Linux client (, run this command in a terminal:

ssh -L 3130:localhost:3128

This redirects connections to TCP port 3130 on the Linux client to TCP port 3128 on You can pick whichever port you like instead of 3130 on the local machine. On the proxy, use whatever port the proxy program is running on (it could be 3128, or 8080, or another port altogether).

When you want to use the proxy, tell your browser to use localhost port 3130 as the proxy (

If you don't want to have to edit your browser settings every time you start and stop using the proxy, use a browser extension such as Foxy Proxy for Firefox or a Chrome equivalent and set it up to use as a proxy only for URLS matching http://access.lan:52050/*.

If you're going to do this often, add the following lines to the file ~/.ssh/config:

Host some_proxy
LocalForward 3130 localhost:3128

Then run ssh some_proxy (you can choose a more significant name than some_proxy).

Note: SSH version 1 is antique. I think the commands I mentioned existed back then, but I didn't check. I'm surprised that an SSH version 1 server is still running. Are you sure you can't use SSH protocol version 2?

|improve this answer|||||
  • the proxy is using only version 1 (out of my control) Red Hat Linux 9 (Shrike) did exactly as above and page cannot be displayed on firefox - checked that loopback address and port 3130 were selected under tools>options>network>settings>manual proxy config also ran ssh -L 3130:localhost:3128 on ok so is listening in on 3130 for tcp connections before making the forwarding decision to > 3128 my question is how does firefox know about via the loopback address that you have asked me to enter into firefox ? – Tony Jan 11 '12 at 5:48
  • I used to use this script many moons ago but does not work anymore, if it helps ssh -1 -f -l username -o "ForwardX11 yes" -o "StrictHostKeyChecking no" -L 6003: sleep 5 >/dev/null 2>&1 xterm -title HTTPSESSION -e ssh -1 -q -o "StrictHostKeyChecking no" -l username -p 6003 -L 8080:access.lan:8080 localhost & – Tony Jan 11 '12 at 6:00
  • @Tony Firefox knows nothing about, it contacts localhost:3130. SSH is listening on localhost:3130 and forwards the request to the remote proxy. Is the proxy still running on (Try a text mode web browser such as w3m or lynx.) What happens if you run http_proxy= wget http://www.google.com/? What is the error in Firefox? – Gilles 'SO- stop being evil' Jan 11 '12 at 9:08
  • my concern is looking at my previous script is that it looks for proxy address where as your advice does not mention this, therefore how does my client listen to ssh port 3130 (apart from me putting this into firefox as a manual proxy 3130 surely this is simply a logical tcp/http port that my browser will try to connect to)? you asked that my listening command is placed onto the system? - remember my client knows not of this, only proxy – Tony Jan 11 '12 at 18:10
  • @Tony Your previous script was similar to what I posted, with different port numbers. Check that you used the correct port numbers. I can't help you more without knowing what happens when you try your old setup (what errors do you see?). – Gilles 'SO- stop being evil' Jan 11 '12 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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