Skip to main content
Kill -9 Club
Sign in

ssh-keygen

SSHPackage: openssh-client

Creates a key pair, changes its passphrase, or prints a fingerprint. The private key never leaves the machine it was made on; the public one is copied wherever you want to log in.

What its options do in the lessons

From the same glossary the lessons render under their commands, so the two cannot disagree.

ssh-keygen -t
The type of key to generate (ed25519 here: short, fast, and the recommended default today).
ssh-keygen -f
The key file to read or write, instead of the default path.
ssh-keygen -l
Shows the fingerprint of the given public key. With -f, this is what lets you compare against the fingerprint offered at connection time.
ssh-keygen -R
Removes every key for a host from ~/.ssh/known_hosts. Silences the changed-key warning — without explaining why it changed.
ssh-keygen -C
The comment attached to the key. It is what tells you, a year later, which machine it came from.
ssh-keygen -N
The key's passphrase. -N '' creates one with none: for service keys only, never for your own.
ssh-keygen -p
Changes the passphrase of an existing private key. The public half does not move, so there is nothing to redeploy: the repair for a key born without one.

Lessons that teach it