SSH Key Types and Sizes: Which to Generate, Which to Retire
The key inspector reads the key's own data, so the type and size it prints do not depend on the label in front of the key.
| Type (first word of the line) | Size shown | Status |
|---|---|---|
ssh-ed25519 | 256 | Recommended. Fixed size; the public key is exactly 32 bytes. |
ecdsa-sha2-nistp256 / 384 / 521 | 256 / 384 / 521 | Fine. Fixed by the curve. |
ssh-rsa | Modulus length, from 2048 up | Works; size is a choice. Under 2048 is rejected by most services. |
ssh-dss | 1024 | Disabled by default since OpenSSH 7.0. Replace. |
sk-ssh-ed25519@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com | 256 | Hardware-backed (FIDO2). The private half stays on the security key. |
What "ssh-rsa" stopped working means
The type name ssh-rsa also names an RSA signature using SHA-1. OpenSSH 8.8 stopped accepting SHA-1 RSA signatures by default. The key itself is not broken: clients that sign with rsa-sha2-256 or rsa-sha2-512 keep working with the same RSA public key. A login that failed after a server upgrade is usually a client too old to offer those, not a bad key.
Generating a new key
ssh-keygen -t ed25519 -a 100 -C "you@host"
Use a passphrase and an agent. Then paste the .pub file into the inspector and compare its fingerprint with the one ssh-keygen -lf prints.
Fingerprints
A fingerprint is the SHA-256 hash of the decoded key data, base64 without padding, prefixed SHA256:. Services display it so you can verify a key out of band. The older colon-separated MD5 form is a different hash of the same data and is not shown here.