Saturday 5 January 2013

Remote Access to Home Router Using SSH Port Forwarding

Here's the problem: I'm going to be at MadLab for the Coder Dojo today and I want to be able to remotely set up new Minecraft servers running on my machine at home. I can SSH in just fine, but to set up a new server I'll need to set up a new port-forwarding rule on my home router. The router is only accessible from within my home LAN.

SSH port-forwarding to the rescue:

At first I thought I could set up a simple local forwarding rule on the server with

ssh -L 8080:

It connected fine, and then I tried in the local browser,


The page returned, but wouldn't let me access the router. It responded with HTTP error of 403 forbidden. Presumably this is because chrome is sending my laptop IP as the source IP.

In order to get round this I tried dynamic SSH forwarding as a SOCKS server:

ssh -C -D 1080

I set up the SOCKS settings in Firefox to proxy port 1080 on local host and...

Bingo! in firefox now gave me access to the router's configuration page.

No comments: