Dynamic Port Forwarding
Ok, i know some of you guys already know how to use Dynamic port forwarding and reverse port forwarding. For those who don't know, this is it. Dynamic port is very useful in this country. This country is blocking a lot of websites. So in order to bypass it, i use dynamic port forwarding. This will actually pass all traffic over the SSH tunnel, which is also secure because of encryption. But be prepared to experience slowness in speed. SOCKS5 must be an option when using Dynamic port forwarding. Below is a simple diagram where in the first diagram, a user connect straight to the internet. In the second diagram, all traffic will pass by a SSH tunnel and encrypted before reaching the destination.
User -------------> Internet
User --------> SSH tunnel ----------> Internet
The command to do so at the SSH server is: ssh -D 1080 email@example.com
Open a browser or any application which supports SOCKS5, enter the settings as shown below.
Close the browser and try to surf. There you go, all HTTP traffic is encrypted over a SSH tunnel. So if someone is sniffing the traffic, all he sees is gibberish encrypted text.
Reverse Port Forwarding
Reverse port forwarding is like a remote shell. This technique atually allows you bypass firewall rules. If a firewall is blocking inbound access on port 22(SSH), you can setup a port in the SSH server which is behind the firewall, and reconnect to it as and when you need it. This is known as Reverse port forwading.
On the SSH Server, type: ssh -R 1080:localhost:22 firstname.lastname@example.org
When you reach home, you type this on your client: ssh -p 1080 user@localhost