Which SSH key should I choose?
Use Ed25519 when both your client and server support it and your policy allows it. It has compact keys and no key-size parameter to configure. RSA remains useful for compatibility or environments with specific cryptographic policy requirements.
ssh-keygen -t ed25519 -C "your-label"
# For a target that requires RSA:
ssh-keygen -t rsa -b 4096 -C "your-label"
Generate production identities locally and set a passphrase when prompted. The browser generator on this page exports an unencrypted private key.
Key sizes are not directly comparable
“256-bit Ed25519” and “4096-bit RSA” describe different mathematical constructions. Ed25519 is generally associated with about 128 bits of classical security. RSA uses much larger keys to reach comparable strength. Choose based on supported algorithms and policy rather than comparing the numbers in their names.
Why does an RSA key fail after an upgrade?
ssh-rsa is also the name of the legacy RSA/SHA-1 signature scheme. OpenSSH 8.8 disabled that scheme by default; it did not disable all RSA keys. Compatible systems can use the same RSA key with SHA-256 or SHA-512 signatures.
Update an old client or server where possible. Avoid globally re-enabling legacy signatures just to reach one host. Follow your platform's compatibility guidance.
Protect and rotate the private key
Keep the private key private, share only its public counterpart, and revoke a key if you suspect exposure. For stronger protection, consider an SSH key backed by a hardware authenticator when your environment supports it.
See the ssh-keygen manual for algorithms, passphrases and supported key formats.