


The SSH server listens on default port 22 (this port can be changed) for incoming TCP connections. Assymetrical encryption is used during the initial key exchange process to produce the shared secret (session key) to encrypt messages for the duration of the session. The client public key must be stored in a location that is accessible by the SSH server to authenticate the server by the client conversely, the server public key must be placed on the client side to authenticate the client by the server. The public can key can be freely shared with anyone to autenticate another party, while the private key must be kept secret. The public key encrypts messages that can only be decrypted by the private key. Assymetric encryption requires two associated keys, the private key and the public key. In symmetric key cryptography, a single key is used by the sending and receiving parties to encrypt and decrypt messages. To secure the transmitted data, SSH employs forms of symmetric encryption, assymetric encryption, and hashing. The client and server authenticate each other and pass commands and output back and forth. SSH uses client-server architecture, connecting an SSH client with an SSH server. Secure Shell (SSH) is cryptographic network protocol for secure remote login, command execution and file transfer over untrusted networks.
#Postgres ssh tunnel how to#
This section discusses how to connect to PostgreSQL through SSH.
