From home I would like to browse my intranet at work where I have a Linux box, which I will call "W", i.e. W.workdomain.com.

My router at home closes port 22 but maps port 2222 to port 22 on my server "S" which resolves to mydomain.org.

My main machine at home, "M", is where I do my work from home. I thought this might work:

W: $ ssh -g -D 6666 -p 2222 mylogin@mydomain.org

On M I tell firefox that S:6666 is the proxy for all sites like *.workdomain.com.

So far my browser on M cannot find the intranet web sites with this scheme.

How do I make this work? What can I use to debug this?

Note: I asked this on serverfault where it was off-topic. Hopefully this is on-topic here.

  • You should clarify the sentence "So far my browser on M cannot find the intranet web sites with this scheme," to indicate whether they cannot find the sites (in which case look at DNS issues) or cannot ping the sites (by IP address) (in which case, look to network issues.) – Michael McNally Feb 2 '13 at 4:15
  • I think if you "tell firefox" about a proxy it is expecting an HTTP proxy server. I don't think you have that. You probably want an SSH tunnel, and you might have to add a static route to home. – Keith Feb 2 '13 at 5:52
  • 2
    Why don't you ask whoever manages your network to help you with this? Most system administrators I know would be none too happy if someone decided to set up their own VPN/Reverse Proxy/SSH tunnel into their network. – ta.speot.is Feb 2 '13 at 9:11
  • ^ that. Your office might have a relatively trouble free, official, and approved VPN system you might be able to use. – Journeyman Geek Feb 2 '13 at 9:52

it appears to me you want to setup something like a reverse socks proxy. This is not directly supported by one ssh client. Instead you may start 2 of them:

W: $ ssh -N -R 1234:localhost:22 -p 2222 mylogin@mydomain.org

this will establish a listening port 1234 on S which gets forwarded to standard sshd port on W

S: $ ssh -N -g -D 6666 -p 1234 localhost

this will setup the socks proxy with gateway port 6666 using the reverse tunnel of above.

your browser(s) anywhere in your home network then should point to S:6666. Be aware that some browsers don't support DNS over socks.

  • This worked and helped me understand what was going on, thank you. I appreciate all the advice from everyone about getting a proper VPN, but this was more about learning than just the end goal. I wish I could up-vote you further, @sparkie. – John Schmitt Feb 2 '13 at 19:29

Go to your network administrator. Tell him you want access.

Depending on the situation (s)he will either:

  • Say "no". IN which case: do not try this unless you like risking getting fired.
  • Or (s)he will tell you how to do it. Possibly by pointing you at the right DNS/HOST entries to get from your home to the 'normal IP' network at work.
  • Or, assuming work uses an ugly kludge like NAT, (s)he can point you to a VPN solution. (Feel free to check the intranet, it might already have an IT section which explain exactly this and already has links to all needed files).

If you set up some kind of VPN you can access the machines at work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.