LAN agent using ssh

129 Views Asked by At

I always need to ssh to a LAN machine (says vm1) which can not access the Internet. In some cases, I need to download some softwares in vm1 (says apt-get install stuffs ...), is there any ways to set up something to enable the remote machine vm1 be capable to access the Internet through the local machine in the ssh session? thx!

1

There are 1 best solutions below

0
On

There are a couple of ways, it depends on what kind of access you need. If you need full access, you can do PPP over SSH, it's not terribly efficient, but it does work. Newer versions of openSSH also support creating TUN interfaces that can be used as a poor man's VPN. If you just need to do something like web browsing, you can set up SSH to act as a proxy server, this is probably the simplest do to. For apt-get and the like, you'd set up SSH as a proxy, then tell apt-get to use that proxy. To get it to work correctly, you'll probably have to SSH to vm1, then ssh from vm1 back to the host machine using the -D options. This all assumes you have control of the ssh daemon on each end of the connect, because a lot of these is disabled on the server by default.