SSH

From UVOO Tech Wiki
Revision as of 16:56, 26 April 2019 by imported>Jeremy-busk
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Tunneling Protocols

Tunnel postgres from local machine to server (most common)

ssh -L 1111:localhost:5432 user@remote.example.com

psql -h localhost -p 1111 -U your-db-username database-name

-g option allows remote hosts to connect to local forwarded ports

https://stackoverflow.com/questions/16835761/postgresql-via-ssh-tunnel

Tunneling is nice when using tools like https://www.sqlmanager.net/en/products/postgresql/manager or https://www.dbvis.com/ which are convenient for complex datastores.

Remote Forwarding Tunnel is another option to look at but if you have ssh access/perms to server the above is usually what you will do

Cheat Sheet

http://www.cheat-sheets.org/saved-copy/OpenSSH_quickref.pdf