Tunneling to Production
One of the great features of SSH is its ability to tunnel any port to a remote server. I’ve used this SSH command often to connect to a production database:
That SSH command takes all traffic to port 27018 on your local host and tunnels it to 27017 on the remote server.
If you rarely use this command, it’s easy to forget it. So why not create the tunnel directly in the scripts that need it using net-ssh-gateway We’ve been using this on Gaug.es and it works great.