TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to use FIDO2 USB keys with SSH

147 pointsby stelabourasalmost 5 years ago

12 comments

spiridowalmost 5 years ago
I&#x27;m really excited to see more and more people talk about FIDO2. If you&#x27;re interested about this topic, I gave a talk about it yesterday: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23689606" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23689606</a>
评论 #23690417 未加载
评论 #23689893 未加载
DCKingalmost 5 years ago
EDIT: I misunderstood the post, and what I describe below is not true!<p>I&#x27;m incredibly excited about FIDO2, but this is quite underwhelming honestly. I&#x27;d like to SSH with a credential on my Yubikey, not by a credential or configuration <i>already stored on my computer</i> that is unlocked by my Yubikey. I&#x27;d like to be able to plug in my Yubikey anywhere and go. My Linux desktop, my Macbook, my Windows desktop, my Android phone.<p>- Yubikey with GPG&#x2F;PIV for SSH: your Yubikey stores your private key. You can take it anywhere, plug it in, [have to go through all the setup required for your computer to talk GPG&#x2F;PIV], and log in.<p>- Yubikey with FIDO2 for SSH: your Yubikey stores a symmetric key to unlock your private key on your computer. [You <i>cannot</i> take it anywhere], plug it in, don&#x27;t have to set anything up if your client and server have this (eventually), and log in.<p>FIDO2 is solving a lot of authentication convenience problems, but not this one I think. I get that this pretty nice when integrating with Windows Hello or Apple&#x27;s TouchID, but I don&#x27;t think FIDO2 USB key with SSH is that great.
评论 #23690789 未加载
评论 #23692352 未加载
评论 #23690778 未加载
ptsptsalmost 5 years ago
I managed to make this work today as described in the article, after installing and configuring the software dependencies.<p>Client-side hardware dependencies:<p>* USB token with U2F (FIDO) support. FIDO2 is optional. Any old YubiKey or similar will work.<p>* For the resident key feature only: USB token with FIDO2 support.<p>* To avoid confusion, only a single USB token should be connected when ssh-keygen is run. (When ssh is run, multiple USB tokens work, the user can touch the wrong one many times, and authentication succeeds after the user touches the right one.)<p>* ED25519 support in the token is optional. (`ssh-keygen -t ecdsa-sk ...&#x27; uses the NIST P-256 curve, which works with all U2F tokens.)<p>Client-side software dependencies:<p>* For communicating with the token over USB, OpenBSD or (Linux with udev).<p>* OpenSSH 8.2p1 or later.<p>* OpenSSH client (ssh) compiled with `configure --with-security-key-builtin&#x27;. Without this, eventually authentication will fail locally with `internal security key support not enabled&#x27;. It&#x27;s possible to work around this by compiling an .so file and specifying it with `ssh -o SecurityKeyProvider=....so&#x27;, but it&#x27;s complicated.<p>Server-side software dependencies:<p>* OpenSSH 8.2p1 or later.<p>* Default OpenSSH server (sshd) settings (without PubkeyAcceptedKeyTypes), or PubkeyAcceptedKeyTypes in &#x2F;etc&#x2F;ssh&#x2F;sshd_config containing sk-ecdsa-sha2-nistp256@openssh.com and (optionally, for ed25519-sk keys) sk-ssh-ed25519@openssh.com .
评论 #23699757 未加载
gratonalmost 5 years ago
I was able to get this going, but it took awhile as I use a non-standard working mode.<p>All of the docs I have read assume that you are logged in locally on the system, but if you are not (like me) then things fall apart.<p>I am running a Windows 10 desktop, and then SSH into my local Linux box from Windows. Both systems are sitting next to me and I can press the Yubikey easily.<p>My local Linux system is running Fedora 32 and I did the following to enable a user connected via SSH to use the Yubikey.<p>Created a user group for yubikey users, which in reality only has me in it.<p>Created a &#x2F;etc&#x2F;polkit-1&#x2F;rules.d&#x2F;99-pcsc-yubikey.rules file which gives smartcard access to the &#x27;yubikey&#x27; group. Without this then &#x27;ykman list&#x27; would not work.<p>Created a &#x2F;etc&#x2F;udev&#x2F;rules.d&#x2F;99-yubikey.rules to give access to the &#x27;yubikey&#x27; group. I used &#x2F;lib&#x2F;udev&#x2F;rules.d&#x2F;69-yubikey.rules as the starting point for my file. I had to add my two Yubikeys USB IDs (lsusb to see them) as they weren&#x27;t present.<p>Made sure to log out and back in to have the &#x27;yubikey&#x27; group be active for my user. I vaguely remember a command that would do it, but I forgot it.<p>After all of that I got it to work :)
michaeltalmost 5 years ago
<i>&gt; be extra careful when using SSH forwarding (the -A option), as the server can then ask your computer to authenticate to other servers on your behalf.</i><p>That would require an extra press of the token&#x27;s button for each extra authentication, right?
评论 #23689779 未加载
评论 #23691105 未加载
评论 #23694268 未加载
simiasalmost 5 years ago
I&#x27;ve been using my Yubikey in GnuPG smartcard mode for years to do the same thing, from what I can see from this tutorial FIDO2 seems a bit easier to setup initially but it also seems much less widely supported at the moment. Are there other tradeoffs to consider?
评论 #23690592 未加载
评论 #23692437 未加载
评论 #23691216 未加载
评论 #23695612 未加载
dborehamalmost 5 years ago
I&#x27;ve waited 10 years for this.
评论 #23689790 未加载
评论 #23692508 未加载
评论 #23693211 未加载
j88439h84almost 5 years ago
Is this instead of typing a password to unlock the ssh key?
评论 #23692430 未加载
decentralbankeralmost 5 years ago
been looking forward to seeing FIDO gain traction for more use cases. i interviewed at a company where there&#x27;s work being done on a FIDO-enabled smartphone approach:<p><a href="https:&#x2F;&#x2F;www.hypr.com&#x2F;passwordless-ssh-linux-fido-login&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.hypr.com&#x2F;passwordless-ssh-linux-fido-login&#x2F;</a>
Bedon292almost 5 years ago
Am I missing something? The commands for resident and non-resident appear to be identical.<p>Edit: They fixed it.
评论 #23689862 未加载
评论 #23689871 未加载
indigodaddyalmost 5 years ago
@StavrosK do you have a writeup on how you put together your blog infrastructure?
评论 #23693499 未加载
RL_Quinealmost 5 years ago
Be aware literally nothing supports this unless it&#x27;s your own kernel.<p>Gitlab? No. Github? No. My gateway with a hand built gentoo kernel? Yes.<p>It seems functional, but you&#x27;ve also got to be aware that `ed25519-sk` and `ecdsa-sk` have sort of spotty support in the devices too. `ed25519-sk` does not work on a Yubikey &lt;5, for example.
评论 #23689713 未加载
评论 #23689743 未加载
评论 #23693243 未加载