28
Automating SSH Tunnel establishment from SSH config file
Posted in General, Linux on August 28th, 2007 by NicolasIn order to setup an ssh tunnel between port 8080 on the local machine and port 80 on the SSH server, you can go and type:
ssh -L8080:localhost:80 machine.example.org -l yourUsernameAtMachineDOTexampleDOTorg
But if you follow the law of the least effort, you won’t want to type that in everytime you need to establish the tunnel, you would rather type:
ssh tunnelName
and have SSH do everything by itself for you! This can be acomplished by inserting the following lines in your ~/.ssh/config file.
Host tunnelName User yourUsernameAtMachineDOTexampleDOTorg Hostname machine.example.org GatewayPorts yes LocalForward 8080 localhost:80
Notice the GatewayPorts yes directive, this is optional for the tunnel to come up but allows you to use the tunnel from other machines than just the one that establishes it!



 A little east of Montpellier, between Uzès and Nimes is the Pont du Gard. This bridge built by the Romans was used as both a road bridge and aqueduct between these two cities. It is the theater of many cultural events as well as a recreational place during summer! At some point in time, people used to dive from it until it was forbidden a few years ago.