

After setting up this proxy tunnel, set the proxy option in browser to 127.0.0.1:p1 and using socks5. Any port larger than 1024 can be chosen as p1. The command is: $ ssh -D p1 is the port on localhost. c0 and s1 in the graph above are the same machine. This proxy server can only be used on localhost, which means the other users can not use it. 1) Proxy listening to localhost port only

Whenever a connection is made to this port, the connection is forwarded over the ssh channel, and the application protocol is then used to determine where to connect to from the remote machine. ssh allocates a socket to listen to port on the local side, optionally bound to the specified ip address. This uses ssh’s “dynamic” port forwarding function by using parameter “-D”.

#PUTTY SSH PROXY HOW TO#
Now let’s look at how to set up proxy by using ssh tunnel. Using ssh as a proxy to browse the web is very useful under some situation: Local access restriction such as behind a strict firewall in some country, company or school You are in a insecure network environment while you want to login to your account. Maybe most of the time c0 and s1 are the same machines as the simple example at the beginning of the post. The overall system can be shown as this: c0:p0 s1:p1 s2:p2 s3 s1 will act as the proxy server, while s2 connects to the service provider (s3). Then we can set up a proxy server system using ssh tunnel. For example, we have a sshd server s2 and another server s1 as the proxy server. We can set up a more complex proxy server through ssh.
