Join our Newsletter — 33% off our NHI Course
Home› Guides› SSH Key Types Reference: RSA, ECDSA, Ed25519, FIDO…
Guide Non-Human Identity (NHI)

SSH Key Types Reference: RSA, ECDSA, Ed25519, FIDO Keys and Certificates Compared for Security

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 12 min read
On this page

Most SSH estates still carry a mix of key types chosen years apart, and some of them now fail to connect, quietly use weak signatures or cannot be protected by hardware. OpenSSH has changed its defaults several times: it disabled SHA-1 RSA signatures in 2021, made Ed25519 the default key type in 2023 and removed DSA entirely in 2025. This reference compares the SSH key algorithms and sizes in use today, FIDO security key types and OpenSSH certificates, gives their current status, and sets out how to choose a type and migrate away from deprecated ones. It is for system administrators, platform engineers and the people who set SSH policy. For the wider lifecycle of discovering, rotating and retiring keys, see the SSH Key Management Guide.

Status: checked against the OpenSSH manual pages and release notes in November 2026. Defaults move between releases, so confirm against the version you run with ssh -V and ssh -Q key.

Key takeaways

  • Ed25519 is the default and the right choice for most new keys. ssh-keygen has generated Ed25519 by default since OpenSSH 9.5 (October 2023); keys are fixed length, small and fast.
  • RSA is fine at 3072 bits with SHA-2 signatures. The ssh-keygen default RSA size is 3072 bits, and only the rsa-sha2-256 and rsa-sha2-512 signature algorithms should be accepted; SHA-1 ssh-rsa has been off by default since OpenSSH 8.8.
  • DSA is gone. OpenSSH 9.8 disabled DSA at compile time and OpenSSH 10.0 (April 2025) removed it, so any remaining ssh-dss key is a migration task, not a configuration choice.
  • FIDO keys bind the private key to hardware. The ecdsa-sk and ed25519-sk types keep the private key inside a security key, so a stolen key file alone is of limited use.
  • Certificates solve the trust problem raw keys cannot. An OpenSSH certificate adds principals, a validity window and a CA signature to any key type, which ends authorized_keys sprawl and trust-on-first-use host keys.

Key types at a glance

Key type (ssh-keygen -t)Wire algorithm namesSizesStatus in current OpenSSHNotes
ed25519ssh-ed25519Fixed (32-byte public key, 64-byte signature)Default since 9.5; recommendedDefined in RFC 8709; best general choice
rsarsa-sha2-512, rsa-sha2-256; legacy ssh-rsaMinimum 1024, default 3072 bitsSupported with SHA-2; ssh-rsa (SHA-1) disabled by default since 8.8Use 3072 bits or more; widest compatibility with old appliances
ecdsaecdsa-sha2-nistp256, -nistp384, -nistp521256, 384 or 521 bitsSupportedUse where NIST curves are required by policy
ed25519-sk[email protected]FixedSupported since 8.2Needs a FIDO token that implements Ed25519
ecdsa-sk[email protected]Fixed (P-256)Supported since 8.2P-256 is mandatory for FIDO tokens, so widest hardware support
mldsa44-ed25519ssh-mldsa44-ed25519FixedListed by current ssh-keygen and in default accepted algorithmsPost-quantum composite; the IETF specification is still a draft, see the PQC SSH Migration Guide
dsassh-dss1024 bitsRemoved in 10.0Replace immediately

Every type except DSA also has a certificate form, named with a [email protected] suffix, for example [email protected].

Approximate security strength, using the equivalences in NIST SP 800-57 Part 1:

Security strengthRSA modulusElliptic curveSSH options
112 bits2048224 to 255 bitsRSA 2048 (minimum for new keys)
128 bits3072256 to 383 bitsRSA 3072, ECDSA P-256, Ed25519, both sk types
192 bits7680384 to 511 bitsECDSA P-384
256 bits15360512 bits and aboveECDSA P-521

None of these classical algorithms resists a future cryptographically relevant quantum computer. For signatures, that is a risk only from the point such a machine exists, unlike key exchange, which faces harvest-now-decrypt-later risk.

RSA

RSA keys remain common because every SSH implementation supports them. The key itself is not the problem; the signature hash is. RFC 8332 (March 2018) defines rsa-sha2-256 (recommended) and rsa-sha2-512 for the same RSA keys, and describes the original SHA-1 ssh-rsa as deficient. OpenSSH 8.8 (September 2021) disabled ssh-rsa signatures by default, noting that SHA-1 chosen-prefix collisions cost under USD 50,000.

  • Size: generate at least 3072 bits (the ssh-keygen default). RFC 8332 points to the NIST position that keys under 2048 bits are not acceptable for US government use. Do not generate 1024-bit keys, even though ssh-keygen still allows them.
  • Server floor: sshd_config RequiredRSASize defaults to 1024 bits; raise it to 2048 or 3072 to refuse weak keys outright.
  • Legacy peers: if a device only speaks ssh-rsa, the 8.8 release notes show a per-host HostkeyAlgorithms +ssh-rsa and PubkeyAcceptedAlgorithms +ssh-rsa override in ~/.ssh/config, as a temporary fix only. Scope it to that host and track it as an exception.

When to choose RSA: when you must reach systems that do not support Ed25519, such as older network appliances or hardware security modules limited to RSA.

ECDSA

ECDSA keys use the NIST curves P-256, P-384 and P-521 (ssh-keygen -t ecdsa -b 256|384|521). They are smaller and faster than RSA at the same strength.

  • Strengths: NIST curves are widely accepted in compliance regimes that require approved algorithms, and P-256 is the curve FIDO tokens must support.
  • Cautions: ECDSA signatures depend on a fresh random nonce for every signature; a weak or repeated nonce can expose the private key. Modern implementations derive nonces safely, but this is one reason many teams prefer Ed25519, which is deterministic by design.
  • Size choice: P-256 gives about 128-bit strength and is enough for most uses; choose P-384 where a policy demands 192-bit strength.

Ed25519

Ed25519 is an EdDSA signature scheme on Curve25519. RFC 8709 (February 2020, Proposed Standard) defines ssh-ed25519 with a 32-octet public key and a 64-octet signature, and ssh-ed448, which OpenSSH does not offer. OpenSSH 9.5 made Ed25519 the ssh-keygen default, describing the public keys as very convenient because of their small size.

  • Why it is the default: fixed size (the -b flag is ignored), deterministic signatures with no per-signature randomness, fast signing and verification, and a short public key that is easy to read and paste.
  • Compliance: NIST added EdDSA to FIPS 186-5 (February 2023). Check whether your FIPS-validated module includes it before assuming it is allowed in a FIPS mode environment.
  • Compatibility: supported by OpenSSH since 6.5 and by current major SSH clients and servers, but some old embedded devices and appliances still lack it.

FIDO keys

OpenSSH 8.2 (February 2020) added the FIDO authenticator-backed types ecdsa-sk and ed25519-sk. The private key never leaves the token; the file on disk holds only a key handle. A user must normally touch the token for each signature.

OptionWhere it is setEffect
-O residentssh-keygenStores the key handle on the token so it can be loaded on another machine with ssh-keygen -K or ssh-add -K; protect with a PIN
-O verify-requiredssh-keygenRequires user verification (for example a PIN) for each signature
-O write-attestationssh-keygenSaves attestation data that can show the key was made in trusted hardware
PubkeyAuthOptions touch-requiredsshd_configServer insists the signature proves user presence
PubkeyAuthOptions verify-requiredsshd_configServer insists the signature proves user verification, such as a PIN
  • Which sk type: FIDO tokens must implement P-256, so ecdsa-sk works with the widest range of hardware; OpenSSH notes that Ed25519 support on tokens is less common. Use ed25519-sk where your fleet of tokens supports it.
  • Limits: touch-per-use makes sk keys a poor fit for unattended automation. For service accounts, use short-lived certificates or a hardware-backed agent instead.

The Security Keys for SSH guide covers rollout, recovery and agent behaviour in depth.

Certificates

An OpenSSH certificate is a public key signed by a certificate authority (CA) key, in OpenSSH's own format, not X.509. Any of the key types above can be certified. ssh-keygen -s signs a key with the CA key, -I sets the key identity that servers log, -n sets the allowed principals (user or host names) and -V sets the validity interval.

ConcernRaw public keysOpenSSH certificates
How a server trusts a userEach key listed in each account's authorized_keysOne CA key in TrustedUserCAKeys; principals decide which account
How a client trusts a hostTrust on first use in known_hosts@cert-authority line for the host CA
ExpiryNone; keys live until removedBuilt in with -V, so short-lived access is the norm
RevocationFind and delete the key everywhereExpiry plus a key revocation list in RevokedKeys
AuditFingerprint onlyKey identity and serial in server logs
Main riskSprawl and orphaned keysThe CA key itself, which must be tightly protected
  • Principals are mandatory in practice: the sshd_config manual notes that certificates without a list of principals are not permitted for authentication with TrustedUserCAKeys.
  • Revocation file safety: if the RevokedKeys file is unreadable, sshd refuses public key authentication for all users, so deploy it carefully.
  • CA key type: the default CASignatureAlgorithms accepts Ed25519, ECDSA, sk types and RSA with SHA-2. An Ed25519 CA key, ideally held in hardware, is a sound default.

See the SSH Protocol and Certificate Authority Guide for CA design and the SSH Keys vs SSH Certificates comparison.

Choosing and migrating

Use caseRecommended typeFallback
Admin and developer interactive accessed25519-sk or ecdsa-sk with a certificateEd25519 with a passphrase and certificate
Automation and service accountsEd25519 with a short-lived certificateEd25519 with a forced command and from= restriction
Host keysEd25519, signed by a host CAECDSA P-256 or RSA 3072 alongside Ed25519 for old clients
FIPS-constrained systemsECDSA P-256 or P-384, or RSA 3072 with SHA-2Ed25519 if your validated module includes EdDSA
Legacy appliancesRSA 3072 with rsa-sha2-256Scoped ssh-rsa exception while the device is replaced

A phased migration away from DSA, short RSA and SHA-1 signatures:

  1. Inventory: collect every authorized_keys entry and host key with its type and size (ssh-keygen -l -f shows bits and type). See How to Find ssh authorized keys across a server fleet.
  2. Measure what is negotiated: raise sshd LogLevel to VERBOSE on a sample of servers to log the key type and fingerprint used for each login, and find who still uses DSA, RSA under 2048 bits or ssh-rsa.
  3. Issue replacements: generate Ed25519 or sk keys for those users and services, and add them alongside the old ones.
  4. Pilot the restriction: on a pilot ring, set PubkeyAcceptedAlgorithms and HostKeyAlgorithms to exclude ssh-rsa, and raise RequiredRSASize to 2048 or 3072. Keep console or out-of-band access in case a change locks you out.
  5. Roll out and remove: extend to all servers, then delete the old keys from authorized_keys and old host key files. Rollback is reverting the sshd_config lines on the affected ring.
  6. Move to certificates: once keys are modern, introduce user and host CAs so future algorithm changes mean reissuing certificates, not editing thousands of files.

Small and large estates: a team with a few dozen servers can move straight to Ed25519 keys and add certificates later. Large estates gain most from certificates first, because they turn migration into a CA policy change.

Where identity fits

Most SSH keys in a large estate belong to automation, not people: deployment pipelines, backup jobs, configuration management and service accounts. These are non-human identities with long-lived credentials, and attackers target both the keys (ATT&CK T1552.004 Private Keys) and the files that trust them (T1098.004 SSH Authorized Keys). Choosing a strong key type is only the start; each key needs an owner, a purpose and an expiry. See the Certificate vs Federated vs Secret Based Machine Identity guide.

Detection and measurement

  • Weak type share: percentage of keys that are DSA, RSA under 3072 bits or only usable with ssh-rsa; target zero.
  • Hardware-backed share: percentage of interactive admin logins using sk keys.
  • Certificate coverage: percentage of servers trusting a user CA, and of hosts presenting a host certificate.
  • Exception count: number of hosts with +ssh-rsa overrides, each with an owner and end date.
  • Login evidence: sshd Accepted publickey log lines at VERBOSE include the key type and fingerprint, which feed the metrics above.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev 5IA-5 Authenticator Management; SC-12 Cryptographic Key Establishment and Management; SC-13 Cryptographic Protection; AC-17 Remote AccessKey strength, lifecycle and approved algorithms for remote access
NIST CSF 2.0PR.AA-01Credentials for users, services and hardware are managed
MITRE ATT&CKT1552.004 Private Keys; T1098.004 SSH Authorized KeysTheft of keys and persistence through trusted key files
IETFRFC 8709; RFC 8332Ed25519 and RSA SHA-2 algorithm definitions

Practitioner checklist

  • Generate new keys as Ed25519, or as ed25519-sk or ecdsa-sk for privileged humans.
  • Generate RSA only where required, at 3072 bits or more, and set RequiredRSASize to at least 2048.
  • Remove every DSA key; it no longer works with OpenSSH 10.0 and later.
  • Keep ssh-rsa out of accepted algorithms, with scoped, dated exceptions only for named legacy hosts.
  • Require verify-required or touch-required for FIDO keys on sensitive servers.
  • Introduce user and host CAs, with an Ed25519 CA key kept in hardware.
  • Log key type and fingerprint at VERBOSE and track the weak type share monthly.
  • Give every automation key an owner, purpose and expiry, ideally via short-lived certificates.

Standards and references

Related NHI Mgmt Group resources: SSH Key Management Guide · SSH Protocol and Certificate Authority Guide · OpenSSH Server Hardening Guide · Security Keys for SSH · SSH Key Compromise Response Playbook

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.