Jump to content

Ssh Into Lan To Access Webserver


7h3kk1d
 Share

Recommended Posts

I have ssh access to my desktop in my home lan by forwarding the port using the router. On this computer I have drupal running in a virtual machine with its own IP address, I was wondering if there was anyway I could use ssh port forwarding to route traffic to the VM from the remote machine through my desktop without forwarding port 80 on my router.

Link to comment
Share on other sites

You could use the following command

ssh -fND localhost:9999 <userame>@<EXTERNALIP>

Then in you internet browse set it to use a socks proxy on localhost port 9999 and you should be able to browse to your internal webserver, as if you were on your home LAN.

A more in depth tutorial is here: http://mysshlog.com/tutorials.php?Page=7 It normally used to secure your internet connection but can be used to browse local web servers, (Poor mans VPN)

Cheers,

Sprouty.

Link to comment
Share on other sites

If you want to ssh into another machine, that's quite simple. You could ssh into your first machine and then ssh into your second machine.

For example:

Internet-> SSH into 1st machine, then from a terminal console from the first machine SSH into 2sd machine.

On the router all you need is to enable forwarding port for the 1st machine, on the 2sd machine you will need to allow incoming SSH traffic. So in practice it should work.

Edited by Infiltrator
Link to comment
Share on other sites

ssh -L localport:remotehost:remoteport SSHuser@SSHhost

That will let you access localport as though it was remotehost:remoteport from SSHhost. Alternatively, you can do

ssh -D localport SSHuser@SSHhost

to create a SOCKS proxy on localport that runs through SSHhost.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...