Skip to content
BENIBIX Learn

SSH Key Passphrase

Infrastructure🔑 SSH & Remote AccessSSH Key Authentication

Also known as Key Passphrase, Passphrase (SSH), Encrypted Private Key

A password that locks your private key file. A stolen copy is then no use.

Think of it like

Think of it like a lock on the box that holds your house key. A thief gets the box, not the key.

Example

Emma's laptop is stolen. Her private key had a passphrase, so the thief cannot use it to reach her servers.

Why it matters

A private key is the key to every server it opens. A passphrase protects it if the laptop is lost.

Definition

A key passphrase is a password that locks your private key file. ssh-keygen asks for one when it makes the key. Without it, anyone who copies the file can use your key. With it, the file is useless until the passphrase is typed. It never goes to the server, only to your own key file.

Example code

console
$ ssh-keygen -t ed25519
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
ssh-keygen asks twice. Leaving it empty means the key file is not locked.
The lock on the private key is the passphrase. The key cannot be used until it is opened.

Common mistake

Leaving it empty because typing it is a bother. ssh-agent fixes the typing, so you need not skip the lock.

Key takeaways

  1. 1
    Locks the file. Not the server, the key.
  2. 2
    Stays local. Never sent over the network.
  3. 3
    Pair it with an agent. Type it once a day.

Compare

Learn it properly