Snowblink
APR 04
29

SSH Port Forwarding

I was discussing setting up a webmail app with a friend. He recommended using SSH port forwarding instead.

This makes much more sense to me: I won't have to mess around with webmail (setting up PHP and SSL) and I will have less ports open.

Quite a simple idea, and actually very good for wireless networks too.

user:laptop ~$ ssh -f -C -N -L1430:localhost:143 -L2525:localhost:25 user@mailhost

You then setup your MUA to use your localhost and the ports defined (1430 for IMAP and 2525 for SMTP in this example). If you want to use lower ports, you'll need root access.

This is not limited to mail. You can forward any TCP port you feel like. Yay for SSH!

user:laptop ~$ ssh -f -C -N -L1190:my.news.server:119 user@server

Useful Books

Tagged As