persistent port forwarding

one of the challenges I’ve had to deal with regularly is port blocking. there is ways around this if you have full access to a server.

you’ll need autossh and screen installed but the jist of the command you want is:

/usr/lib/autossh/autossh -i /home/username/.ssh/id_dsa username@servername.local -L 25:servername.local:25 -g -N

with this command your server will auto reconnect and keep the connection open indefinitely. as you can see from the example above, port 25 and other lower ports will require root user access.