In preparation for a lengthy business trip, I set up my router such that I can access my home computer over the internet via port forwarding over SSH. One thing I neglected to do was setup access to my router remotely. Normally, I can just access the router configuration page via
192.168.1.1
.I know that it’s possible to tunnel traffic through SSH, but how do I access an IP address as if I were on my home network using SSH?
Answer
If you’re already away from home and didn’t enable the port mapping to the SSH port, you may not have any recourse.
If you do have SSH access to your system, you can establish an SSH tunnel through your exposed host to access some local resources.
For example, if your router’s configuration page is: 192.168.1.1 and you’re connecting from a Unix-like host (you didn’t specify the operating systems involved):
sudo ssh -L 80:192.168.1.1:80 username@external_IP
Where external_IP
is the internet-facing IP address of your home computer/router and username
is the user name on that system. If the connection is successful, you’ll be able to point your mobile system to http://127.0.0.1
to access the router page.
Attribution
Source : Link , Question Author : NT3RP , Answer Author : ewwhite