Difference between revisions of "Ssh tunnel"

From wikieduonline
Jump to navigation Jump to search
Line 5: Line 5:
  
 
Run on your [[jump server]] or [[bastion]] host:
 
Run on your [[jump server]] or [[bastion]] host:
* <code>[[ssh -L]] 1111:localhost:5432 user@remote.example.com</code>
+
* <code>[[ssh -L]] 1111:localhost:5432 user@your-jump-server.com</code>
[[psql -h]] localhost -p 1111 -U your-db-username database-name
+
 
 +
Connecto to the tunnel:
 +
* <code>[[psql -h]] localhost -p 1111 -U your-db-username database-name</code>
  
  

Revision as of 12:02, 20 February 2023


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

Run on your jump server or bastion host:

Connecto to the tunnel:

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


ssh -N -f -L 1111:localhost:5432 [email protected]


2023-02-03 17:06:31.995 UTC [36921] postgres@postgres DETAIL:  User "postgres" has no password assigned

Related

See also

Advertising: