Jump to content

How-To:Port Forwarding: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
(Submitted by [[User:nit|nit]], pasted & edited by [[User:Igy|igy]])
==Why?==
==Why?==
One example of why port forwarding is great is security.
One example of why port forwarding is great is security. Downloading email and browsing the Internet in such a way that the immediate (local) network does not know what you are doing. All it sees is encrypted SSH traffic, like that used when you type on RedBrick normally.
Downloading email and browsing the Internet in such a way that the immediate (local) network does not know what you are doing. All it sees is encrypted SSH traffic, like that used when you type on [RedBrick] normally.
 
Thus you can (a little more) securely access your stuff from wireless hotspots
or from other insecure or filtered networks.


The example being given is to use your redbrick account to port forward data to the
The example being given is to use your Redbrick account to port forward data via Redbrick. You can then configure local applications to use the tunnel rather than the usual route over say insecure wireless or hotel wifi thereby hopefully securing your data in transit.
dcu proxy. You can then configure local applications to use the tunnel
rather than the usual route.


==Theory==
==Theory==
One good online guide is: http://neworder.box.sk/newsread.php?newsid=12498
There are some [https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding good online guides] and if you read this you should be able to deduce the basics of how SSH works with port forwarding.
and if you read this you should be able to deduce the basics of how SSH works with port forwarding.


==How To do it==  
==How To do it==  
Line 24: Line 15:


[[PuTTY]] has built-in support for port forwarding.
[[PuTTY]] has built-in support for port forwarding.
* When you're connecting, after you've filled in the host name box ('''NOTE:''' If you wish to forward traffic through the DCU proxy the host name '''must''' be login.redbrick.dcu.ie), click on Tunnels in the left-hand bar (second last item from the bottom).
* When you're connecting, after you've filled in the host name box ('''NOTE:''' If you wish to forward traffic through the RedBrick the host name '''must''' be login.redbrick.dcu.ie), click on Tunnels in the left-hand bar (second last item from the bottom).
* In the Port forwarding box, fill in the following values:
* In the Port forwarding box, fill in the following values:
** Source port: (the port you want forwarded to the proxy - eg 1337)
** Source port: (the port you want forwarded to the proxy - eg 1337)
** Destination: proxy.dcu.ie:3128
** Destination: <blank>
* Ensure Local is selected as the type and then click Add
* Ensure Dynamic is selected as the type and then click Add


[[Image:puttyconf.png]]
[[Image:puttyconf.png]]


* Click the Open button to connect, and enter your username/password.
* Click the Open button to connect, and enter your username/password.
* Tell Firefox (or anything else) to use localhost:1337 as its HTTP proxy. You should now be browsing via DCU's proxy server!
* Tell Firefox (or anything else) to use localhost 1337 as its HTTP proxy. You should now be browsing via RedBrick!


'''OpenSSH for Windows'''
'''OpenSSH for Windows'''
Line 42: Line 33:


If you read the neworder guide above you should have a good idea of how to build the SSH command for the forwarding, like so:
If you read the neworder guide above you should have a good idea of how to build the SSH command for the forwarding, like so:
  ssh -L 1337:proxy.dcu.ie:3128 login.redbrick.dcu.ie
  ssh -D 1337 username@login.redbrick.dcu.ie


Where :
Where :