Thursday, 29 March 2012

Access a remote service localy via ssh

This will be just a short reminder for myself not to forget how to forward a remote service's port to a local one through ssh. Here is the schema:
ssh -i .ssh/ssh_keys/root -L 55432:localhost:5432 root@thinks.iamallama.com
With -i we use a private key to the remote host's user named root at the end. Next we say we want to access a local port -55432- and send the data through that one to the remote port -5432-. We want to use our localhost to address the service which is hosted on the thinks.iamallama.com machine.

This wraps it up. ^_^