Let us suppose that you have a machine on a network that is connected to the internet and you have another machine on the same network that does not have any Internet connection, now how to share the internet connection ??
We can use SSH Dynamic port forwarding to we can easily share the internet by setting up the machine with an internet connection to act as the SOCKS4 proxy using an SSH tunnel
for dynamic port forwarding use the following:- ssh -C -D 1080 username@ip-addr (Ex:- ssh -C -D 1080 tom@192.168.0.16 )
Next you would tell Firefox to use your proxy:
* go to Edit -> Preferences -> Advanced -> Network -> Connection -> Settings...
* check "Manual proxy configuration"
* make sure "Use this proxy server for all protocols" is cleared
* clear "HTTP Proxy", "SSL Proxy", "FTP Proxy", and "Gopher Proxy" fields
* enter "127.0.0.1" for "SOCKS Host"
* enter "1080" (or whatever port you chose) for Port.
You can also set Firefox to use the DNS through that proxy, so even your DNS lookups are secure:
* Type in about:config in the Firefox address bar
* Find the key called "network.proxy.socks_remote_dns" and set it to true
The SOCKS proxy will stop working when you close your SSH session. You will need to change these settings back to normal in order for Firefox to work again.
To make other programs use your SSH proxy server, you will need to configure each program in a similar way.
see:- https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding
Tested on ubuntu 10.04
No comments:
Post a Comment