Generating Keys
procedureOne command—ssh-keygen—creates every kind of key pair. The choices that matter are the algorithm (-t ed25519 for disk keys, -t ed25519-sk for hardware-backed keys), the filename (-f), the comment (-C), and whether to set a passphrase.
create a standard ssh key pair
ssh-keygen -t ed25519 -f ~/.ssh/id_example -C "example@laptop"
What this does:
- Creates private key:
id_example - Creates public key:
id_example.pub
Options:
-t ed25519—Key algorithm (modern, recommended)-f ~/.ssh/id_example—Name of key files-C "comment"—Metadata label (optional but helpful)
When prompted for passphrase:
- Enter strong passphrase (20+ characters) for security
- OR press Enter for no passphrase (convenient but risky)
For hardware-backed keys the algorithm changes to -t ed25519-sk (with -O resident for resident keys)—the setup procedures for those have their own nodes.
change passphrase on existing key
ssh-keygen -p -f ~/.ssh/id_example
What this does:
- Re-encrypts the private key with new passphrase
- Does NOT change the key itself
- Public key remains valid
change comment on existing key
ssh-keygen -c -f ~/.ssh/id_example
What this does:
- Updates the metadata label only
- Does NOT affect authentication