Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 am connected using SSH to a Ubuntu Box which is behind firewall and routers. From that Ubuntu box i need to open a router web page and login to the router for doing some changes.

How can i from command line open a web-browser which can allow me to do the similar web browsing in that LAN network?

I used lynx but its not helping me to do the main job. Anything else.

EDIT: using lynx i get this problem where i need javascript to have router web access.

<<<                                                                                                                                                   Linksys Smart Wi-Fi
JavaScript is required

   JavaScript is required to use Linksys Smart Wi-Fi Tools. Please change the security settings in your browser to enable JavaScript.

: q
  Arrow keys: Up and Down to move.  Right to follow a link; Left to go back.
 H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list 


Step 1: remote laptop

$ ssh -ND 9009 sun@82.x.x.x
password: ......

Step 2: open firefox > do the settings like this:

enter image description here

Step 3: go to site and start surfing

it works.

share|improve this question
up vote 9 down vote accepted

You could use SSH as a proxy and then use a local browser to use that proxy.

ssh -ND 8080

That sets a SOCKS proxy. Just edit your browser's proxy settings to IP: localhost Port: 8080 and your traffic is going out over SSH.

Just remember that all your browser's traffic is going through the proxy until you disable it so don't do anything against network policy while you're logged in. I might suggest using a private instance of Chrome, for example.

Note: This probably won't work for domain lookups so you'll need the local (to the SSH host) IP of the router.

share|improve this answer
Please see here its failing to open any other sites: – YumYumYum Jun 6 '13 at 11:50
I've just tested against one of my servers using your commands and it "works for me". Suggests that the server might be set up with AllowTcpForwarding no in its /etc/ssh/sshd_config. If that is the case, are there any other open ports to the SSH host? – Oli Jun 6 '13 at 11:59
AllowTcpForwarding do not exists in my config file. I tried this second answer which was working e.g: ssh -vvvvL 9009: sun@82.x.x.x – YumYumYum Jun 6 '13 at 12:02
I've just seen your problem. Per my answer this is not a HTTP proxy, this is a SOCKS proxy. You filled in the wrong box in your browser's proxy settings. Fix that and it should all work. Note Chrome needed to be restarted. Not sure about Firefox. – Oli Jun 6 '13 at 12:19
Unset the HTTP proxy box. It's a completely different thing. I have just tested this with Firefox, if you set HTTP (with all checked), it doesn't work. If you set SOCKS alone, it works. – Oli Jun 6 '13 at 12:38

I would personally setup a SSH tunnel to allow you to view it in a web browser on your machine.

ssh -L 8080:ipofrouter:80 <host>

This would then allow you to go to the IP of the router on port 8080 locally to view your routers configuration page.

So to access it you would enter


I hope this helps

share|improve this answer
This is a nice solution if the router and SSH host are the same machine. – Oli Jun 6 '13 at 11:39
How do i tell $ ssh -vL 9009:any ip or dns to 80 sun@sshServer ? Then one i tried works only to access the router but can i do any other sites also browse-able? – YumYumYum Jun 6 '13 at 12:08
@YumYumYum do you mean can you continue to browse sites normally on your local machine or are you looking to be able to view any site on port 9090 as if you were on the local network ? – Tim Lassie Freeborn Jun 6 '13 at 12:37

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.