68

ssh-keygen has the following options for a key type (-t):

dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa

I am not familiar with the -sk notation and it's not explained in the man page.

What does it mean?

1
  • It's not explained, but at least one option under CERTIFICATES is described as limited to "the FIDO authenticator algorithms ecdsa-sk and ed25519-sk" Commented Feb 11, 2022 at 1:14

2 Answers 2

49

In OpenSSH FIDO devices are supported by new public key types "ecdsa-sk" and "ed25519-sk", along with corresponding certificate types.

To quote:

FIDO/U2F Support

This release adds support for FIDO/U2F hardware authenticators to OpenSSH. U2F/FIDO are open standards for inexpensive two-factor authentication hardware that are widely used for website authentication. In OpenSSH FIDO devices are supported by new public key types "ecdsa-sk" and "ed25519-sk", along with corresponding certificate types.

Source: https://www.openssh.com/txt/release-8.2

These "-sk" variants can only be created with a YubiKey or compatible FIDO/U2F token and the token is required to use the private key.

1
  • 22
    From my understanding these -sk variants can only be created with a YubiKey or compatible FIDO/U2F token and the token is required to use the private key. This could be clearer in your answer. Commented Nov 28, 2021 at 17:02
35

-sk SSH key-pairs can be either ecdsa-sk or ed25519-sk. The -sk extension stands for security key. Note that an ed25519-sk key-pair is only supported by new YubiKeys with firmware 5.2.3 or higher which supports FIDO2. This means YubiKeys with firmware below 5.2.3 are only compatible with ecdsa-sk key-pairs. If possible, generate an ed25519-sk SSH key-pair for this reason. Source: https://cryptsus.com/blog/how-to-configure-openssh-with-yubikey-security-keys-u2f-otp-authentication-ed25519-sk-ecdsa-sk-on-ubuntu-18.04.html

5
  • 3
    Welcome to Stack Exchange. Great first answer - I would however note that there are problems with DSA and ECDSA. ED25519 is definitely the preferred of the two.
    – user163495
    Commented Nov 20, 2020 at 11:10
  • @MechMK1 I agree. If you have the choice use EdDSA. On the other hand, DSA only requires good random numbers so for many applications it's fine. And especially a Yubikey will probably have a good hardware based rng and no issues. Commented Nov 20, 2020 at 12:32
  • 1
    DSA should not be used because it is not secure. In versions > 7 of OpenSSH dsa algorithms are deprecated. So there is no need to use dsa keys. Commented Mar 4, 2021 at 10:26
  • 1
    The original source from which you copied-and-pasted parts of your answer has a link behind "for this reason", which explains why one should generate ed25519-sk keys. Your answer make a point only for ecdsa-sk keys (namely, compatibility).
    – bers
    Commented May 16, 2021 at 10:42
  • 3
    @Anonymous20DB28 seems like you missed the point a bit... E/C/DSA, or Elliptical Curve DSA, shares the same parametric flaw as exponential DSA, and aside from being very vulnerable to less than stellar RNG, can be made entirely solvable (and thus useless) in multiple scenarios (static k value for example). Whenever possible, Ed25519 should be used instead, and if not possible, a 4096-bit RSA key is preferred to any form of DSA.
    – Zach
    Commented Jun 2, 2021 at 9:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .