Home/Glossary/SSH key

SSH key

An authentication credential for the SSH protocol that uses a pair of cryptographic keys for secure server access.

An SSH key is a pair of cryptographic files used to identify a user when connecting to a remote server. Unlike passwords, keys are resistant to brute-force attacks and enable automated access without manual credential entry.

The technology operates on asymmetric encryption, consisting of a public key and a private key. The public key is placed on the server in the ~/.ssh/authorized_keys file, while the private key remains on the user's local machine. During login, the server verifies ownership of the private key without it ever being transmitted over the network.

SSH keys are used for Linux server administration, infrastructure management via Ansible or Terraform, and Git repository access. They are a security standard for cloud providers, where password authentication is often disabled by default.

Example

To generate a key pair, use the command ssh-keygen -t ed25519. The Ed25519 algorithm provides high security with a key length of only 256 bits, making it faster and more secure than legacy RSA keys with 2048 or 4096 bits.