Meet Modi
Back to Blog
·9 min

ssh-keygen now makes P-384 keys by default, and EC2 won't take them

OpenSSH's ssh-keygen now makes ECDSA P-384 keys when you skip -t. GitHub, GitLab and Bitbucket accept them. EC2 key pairs and FIDO keys don't.

By Meet Modi
SSHOpenSSHECDSASecurityDeveloper Tools

The commit that changed what a bare `ssh-keygen` gives you is three lines long and has no reason in it. It reads "switch default key type generated to ECDSA NISTP384; ok markus@", and that is the whole message. A minute later a second commit was meant to drop Ed25519 down the signature preference list, and didn't. It took a third one late the next day, titled "actually change the default signature algorithm", to finish the job.

So if you are searching for the best SSH key type this week, here is the short answer. Ed25519 keys you already have still work everywhere they worked on Monday, and nothing published says they are broken. For a new key, ECDSA P-384 is what OpenSSH now picks for you. It works on GitHub, GitLab and Bitbucket. It does not work as an EC2 key pair, Azure DevOps' docs say RSA only, and hardware FIDO keys can't do it at all. Pass `-t` every time and you choose, not the version of ssh-keygen that happens to be installed.

What changed in ssh-keygen this week

  1. Nov 5
    OpenSSH 10.6p2 is released. Its ssh-keygen makes Ed25519 when you don't pass -t, as every release has since 9.5 in 2023.
  2. Dec 3, 08:40 UTC
    Commit 5b63da2: DEFAULT_KEY_TYPE_NAME goes from "ed25519" to "ecdsa" and DEFAULT_BITS_ECDSA from 256 to 384.
  3. Dec 3, 08:41 UTC
    Commit 0b47a8f reorders the default signature algorithms to prefer the ML-DSA 44/Ed25519 hybrid followed by P-384. Plain ssh-ed25519 is left at the top of the non-certificate list.
  4. Dec 4, 09:23 UTC
    The ssh-keygen man page is synced: "ecdsa (the default)".
  5. Dec 4, 23:02 UTC
    Commit 310181f, "actually change the default signature algorithm", moves ssh-ed25519 below ecdsa-sha2-nistp384.
  6. Dec 5, 00:42 UTC
    Commit fc6f265 adds ssh-mldsa87-p384, a composite of ML-DSA-87 and P-384. "Not yet enabled by default."

Why OpenSSH moved off Ed25519 as the default

Officially, nobody has said. The commit messages don't, and OpenBSD's own news site lists the three changes under the post-quantum push without adding a reason. What sits around them is public. On December 2 the NSA advisory listed "elliptic curves other than P-384 or P-521" and EdDSA among algorithms to inventory. On December 5, two days after the commit, Anthropic and OpenAI said jointly that their researchers had found weaknesses in "some" cryptography that protects the internet, that NIST's post-quantum standards are not affected, and that they would not publish methods. The statement names no curve.

Reading the commit as a reaction to that is reasonable, and it is still a reading. P-384 is the curve on the approved side of the NSA's list, and it is the same line Chrome drew when it said it would stop trusting P-256 CA keys next March. Nothing published says Ed25519 is broken. Note also what P-384 is not: it is still elliptic curve, so it does nothing against a future quantum computer. The quantum answer in OpenSSH is the ML-DSA hybrids, which is why one of them now sits above P-384 in the preference order.

I built OpenSSH master and ran ssh-keygen with no -t

On a Linux box with Ubuntu's OpenSSH 10.2p1 installed, I cloned openssh-portable at its December 5 head, built it, and ran the two side by side. Same command, no flags beyond a blank passphrase:

$ ./ssh-keygen -N "" -C demo        # master, Dec 5
Generating public/private ecdsa key pair.
Enter file in which to save the key (/home/runner/.ssh/id_ecdsa):

$ /usr/bin/ssh-keygen -N "" -C demo # Ubuntu OpenSSH_10.2p1
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/runner/.ssh/id_ed25519):

$ ./ssh -V
OpenSSH_10.6p2, OpenSSL 3.5.5 27 Jan 2026

Two things worth noticing. The file name changes too, from id_ed25519 to id_ecdsa, so a new default key sits next to your old one instead of overwriting it. And the master build still calls itself 10.6p2, so `ssh -V` can't tell you whether you have the new default. Asking ssh-keygen what it would make is the only honest test.

Servers get the change as well. On a fresh machine, `ssh-keygen -A` generates the host keys sshd needs. On master it now makes five where 10.2p1 made three, and the ECDSA one is 384 bits instead of 256:

# master
ssh-keygen: generating new host keys: RSA ECDSA ED25519 MLDSA44-ED25519 MLDSA87-P384
# Ubuntu 10.2p1
ssh-keygen: generating new host keys: RSA ECDSA ED25519

Ed25519 vs ECDSA P-384: size and speed

I generated one of each type with the master build and measured the public key line, the thing you paste into GitHub or authorized_keys. Then OpenSSL's benchmark for the three curves, on a 2-core Xeon runner:

type               bits   public key line
ed25519             256    83 bytes
ecdsa (P-256)       256   163 bytes
ecdsa (P-384)       384   207 bytes   <- new default
rsa                3072   555 bytes
mldsa44-ed25519     512  1851 bytes
mldsa87-p384        640  3644 bytes

$ openssl speed -seconds 3 ecdsap256 ecdsap384 ed25519
                              sign/s   verify/s
 256 bits ecdsa (nistp256)   54239.8   16647.0
 384 bits ecdsa (nistp384)    6898.3    3040.5
 253 bits EdDSA (Ed25519)    32179.3   11733.7

P-384 signs about 4.7 times slower than Ed25519 here and verifies about 3.9 times slower. For you logging in, that is roughly 0.15 milliseconds per signature, which you will never feel. For a server verifying thousands of logins a second, it is a real number to plan for. The key is also two and a half times longer, which matters only if you are pasting it somewhere with a length limit.

Does GitHub accept ECDSA P-384 SSH keys?

Yes, and so do GitLab and Bitbucket. During login, a server sends a list called server-sig-algs, the signature types it will accept for user keys. I connected to each host with a P-384 key I had just made and registered nowhere, and read that list from the verbose log:

$ ssh -vv -i id_probe git@gitlab.com 2>&1 | grep server-sig-algs
server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,
  ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,rsa-sha2-512,
  ssh-rsa,ssh-dss,ssh-mldsa-44,ssh-mldsa-65,ssh-mldsa-87>
git@gitlab.com: Permission denied (publickey).

# github.com:     ... ssh-ed25519, ecdsa-sha2-nistp521, ecdsa-sha2-nistp384, ecdsa-sha2-nistp256, rsa-sha2-512 ...
# bitbucket.org:  ... ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521 ...
# ssh.dev.azure.com:  rsa-sha2-256, rsa-sha2-512

"Permission denied" is the right answer for a key nobody registered. What matters is that P-384 is on the list, and on all three it is. That is a different story from the post-quantum SSH key I tried on GitHub three days ago, where the server didn't list the type and stopped answering. GitHub's own guide still says `ssh-keygen -t ed25519`, and since it always passes -t, it won't change under you.

Old known_hosts and old clients keep working

The other worry with a changed preference order is a wall of "host key has changed" warnings. I ran master's sshd locally with Ed25519, P-384 and ML-DSA hybrid host keys, then connected three ways:

  • Master client, empty known_hosts: it picked ssh-mldsa44-ed25519, the new first choice, and logged in with the P-384 user key.
  • Ubuntu's 10.2p1 client: it picked ssh-ed25519 and logged in with the same P-384 user key. Old clients read P-384 user keys fine.
  • Master client, known_hosts holding only the server's old Ed25519 key, StrictHostKeyChecking=yes: "Host is known and matches the ED25519 host key", no prompt. The client prefers an algorithm it already has a key for.

One ordering detail. When you don't name a key, ssh tries id_rsa, then id_ecdsa, then id_ed25519. So if you make a new default key next to your old one, it gets offered first. On a host with a low MaxAuthTries, or on Azure DevOps, which takes the first key and stops, that ordering is the difference between working and not.

The catch: EC2, Azure DevOps and FIDO keys

The places that break are the ones that take a pasted public key and check its type. AWS's key pair docs say it plainly: "Amazon EC2 supports 2048-bit SSH-2 RSA keys for Linux and Windows instances. Amazon EC2 also supports ED25519 keys for Linux instances." ECDSA is not on the import list. Someone who upgrades OpenSSH, runs a bare ssh-keygen and pastes the result into Import key pair is going to hit that. I had no AWS account to use here, so that is the docs, not a run. You can still drop a P-384 key into authorized_keys on the instance yourself. It is the key pair feature that refuses it.

Azure DevOps' guide says "Azure DevOps supports RSA keys for SSH authentication" and tells you to run `ssh-keygen -t rsa -b 3072`. Its server only advertises rsa-sha2-256 and rsa-sha2-512. The handshake was looser than that: it let an unregistered P-384 key through to "Shell access is not supported", same as an RSA key, while an Ed25519 key got "Permission denied" at the door. Azure checks the key per repository later, so getting past the handshake proves nothing. I couldn't register an ECDSA key to see whether its settings page takes one. Go with the docs: RSA.

Hardware keys are the third gap. In OpenSSH's FIDO code the ECDSA security key type is hardcoded to P-256 (`key->ecdsa_nid = NID_X9_62_prime256v1` in ssh-sk.c), and the only sk ECDSA algorithm it knows is sk-ecdsa-sha2-nistp256. There is no P-384 option for a YubiKey in SSH. If you were moving off P-256 on principle, ed25519-sk is the hardware choice that's left.

And the obvious one: this is not in a release. Your laptop, your CI image and your distro's package will keep making Ed25519 until OpenSSH ships a release with the change and they pick it up. Some may patch it back. Any script or onboarding doc that runs ssh-keygen without -t will quietly change behaviour on whatever day that happens, on some machines and not others.

What is the best SSH key type now?

It depends on where the key goes, which is the boring answer and the right one. Name the type every time:

# What does your ssh-keygen make by default? Make a throwaway key and look
$ ssh-keygen -q -N "" -f /tmp/k && ssh-keygen -lf /tmp/k.pub && rm /tmp/k /tmp/k.pub
384 SHA256:... (ECDSA)      # master. A release today prints 256 ... (ED25519)

# What type is a key you already have?
$ ssh-keygen -lf ~/.ssh/id_ed25519.pub
256 SHA256:... you@laptop (ED25519)

# GitHub, GitLab, Bitbucket, your own servers: either works
$ ssh-keygen -t ecdsa -b 384 -C "you@laptop"
$ ssh-keygen -t ed25519 -C "you@laptop"

# EC2 key pairs: ed25519 (Linux) or rsa
$ ssh-keygen -t ed25519 -f ~/.ssh/aws-ec2

# Azure DevOps: rsa, per its docs
$ ssh-keygen -t rsa -b 3072 -f ~/.ssh/azure-devops

If you keep a separate key per destination, pin each one in ~/.ssh/config so the identity file order stops mattering:

Host ssh.dev.azure.com
  IdentityFile ~/.ssh/azure-devops
  IdentitiesOnly yes

Host github.com
  IdentityFile ~/.ssh/id_ecdsa
  IdentitiesOnly yes

As for rotating the Ed25519 keys you already have: on what is public today, I wouldn't do it in a hurry. The joint statement names no curve, nothing published shows a practical attack on Ed25519, and the keys you would rotate to are still elliptic curve. The step that actually protects against harvest now, decrypt later is post-quantum key exchange, and current OpenSSH clients already use it by default with GitHub, GitLab and Bitbucket.

What is the default key type for ssh-keygen?

In every OpenSSH release from 9.5 to 10.6p2, ssh-keygen makes an Ed25519 key when you don't pass -t. On the development branch since December 3, 2026, the default is ECDSA on the P-384 curve, saved as ~/.ssh/id_ecdsa. Run ssh-keygen and read the first line it prints to see which one yours makes.

Is ECDSA P-384 better than Ed25519 for SSH?

Neither is clearly better on public evidence. P-384 is on the NSA's approved list and is OpenSSH's new default, while Ed25519 is faster and shorter and has no published break. In my test P-384 signed about 4.7 times slower, still well under a millisecond. Neither resists a quantum computer, so the real upgrade is an ML-DSA hybrid key.

Does GitHub support ECDSA P-384 SSH keys?

Yes. GitHub's SSH server lists ecdsa-sha2-nistp384 among the signature types it accepts for user keys, next to Ed25519, P-256, P-521 and RSA. GitLab and Bitbucket list it too. GitHub's documentation still tells you to run ssh-keygen -t ed25519, and either key type works for cloning and pushing.

Can I use an ECDSA key for an AWS EC2 key pair?

No, according to AWS's documentation. EC2 key pairs, created or imported, support RSA for Linux and Windows and ED25519 for Linux only. A P-384 key from a newer ssh-keygen will not import. Use ssh-keygen -t ed25519 for EC2, or add an ECDSA key to the instance's authorized_keys file yourself after launch.

Do I need to replace my Ed25519 SSH key?

Not on current public facts. OpenSSH changed the default for new keys only, existing Ed25519 keys still work with every client and server I tested, and no published attack breaks Ed25519. Watch for a named curve in follow-ups to the Anthropic and OpenAI statement. If one appears, rotate then, ideally to a post-quantum hybrid.

How do I check what type my SSH key is?

Run ssh-keygen -lf followed by the path to the public key, for example ssh-keygen -lf ~/.ssh/id_ed25519.pub. The output ends with the type in brackets, such as (ED25519), (ECDSA) or (RSA), and starts with the size in bits. For ECDSA, 256 means P-256 and 384 means P-384.

Can a YubiKey make a P-384 SSH key?

Not with OpenSSH. Its security key type ecdsa-sk is fixed to the P-256 curve in the source, and the only hardware ECDSA algorithm it supports is sk-ecdsa-sha2-nistp256. The other hardware option is ed25519-sk, which needs a key with Ed25519 support. A P-384 key has to live in a file or an agent.

  1. upstream: switch default key type generated to ECDSA NISTP384 (5b63da2), openssh/openssh-portable on GitHub
  2. upstream: change the default signature algorithm preference order (0b47a8f), openssh/openssh-portable on GitHub
  3. upstream: actually change the default signature algorithm (310181f), openssh/openssh-portable on GitHub
  4. upstream: Sync man page, default key type was changed (f32a9f6), openssh/openssh-portable on GitHub
  5. upstream: Add support for composite ML-DSA 87 / ECDSA p384 (fc6f265), openssh/openssh-portable on GitHub
  6. OpenSSH release notes, OpenSSH
  7. OpenSSH 9.5 release notes: generate Ed25519 keys by default, OpenSSH
  8. Cryptography changes in OpenSSH (in OpenBSD -current), OpenBSD Journal
  9. Immediate Actions to Push Toward Post-Quantum (CSA PP-26-4956), NSA
  10. Joint statement from Anthropic and OpenAI on recent advances in cryptography, Anthropic
  11. Create a key pair for your Amazon EC2 instance, AWS
  12. Use SSH key authentication, Azure Repos, Microsoft Learn
  13. Generating a new SSH key and adding it to the ssh-agent, GitHub Docs

More Posts