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

EDIT:

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 icanhazip.com and start surfing

it works.

share|improve this question

2 Answers 2

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 user@server.example.com

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: paste.ubuntu.com/5738517 –  YumYumYum Jun 6 '13 at 11:50
1  
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:192.168.0.1:80 sun@82.x.x.x –  YumYumYum Jun 6 '13 at 12:02
1  
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
1  
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

http://localhost:8080

I hope this helps

share|improve this answer
2  
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
1  
@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

 
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.