Live data from Hacker News

Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

github.com

11–20 of 53 posts

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#11
post #8

Is it considered good practice to create the key on the yubi and not have a backup? Or alternatively a master key to sign the key on the yubi so you can create a new subkey if you lose the yubi?

You have 2 physical Yubikeys and no backup anywhere else.

One way to achieve it is by generating it on a RAM disk and throwing it away, once it's on both Yubikeys. I blogged about it here https://blog.snapdragon.cc/2019/04/27/using-a-yubikey-to-sec... (for macOS)

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#12
post #2

I use it with PKCS#11 mode and can't confirm some of the drawbacks the author mentions under Alternatives : > The UX of this solution is poor: [...] and needs manual reloading every time the YubiKey is unplugged or the machine goes to sleep. I never have to re-enter the PIN after sleep and can even unplug it for a while to use the port for HDMI output. Still good to see some work in this space. Native OpenSSH support…

I can confirm the author's experience with Apple's SSH-agent implementation. It does not allow you to load Yubikey agent libraries from Homebrew's default /usr/local, which makes it an inconvenience to set up.

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#13

Earlier quoted context omitted.

You may want to read the recent discussion on HN about OnlyKey before using one: https://news.ycombinator.com/item?id=21884184

Thank you very much for the link, I missed that discussion. I had no idea the security of OnlyKey was so terrible, in light of this I will stop recommending it.

I'm really excited about the next SoloKey coming out soon.

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#14
I have been trying to use Yubikey for SSH over the years, and everything has been a huge hassle that just didn't work well enough.

Everything, that is, until SSH 8.2 came out. Using a Yubikey (or any other U2F-compatible key, which is a lot of them) is a breeze: Run `ssh-keygen -t ecdsa-sk -f ~/.ssh/id_ecdsa_sk` to generate a key from your Yubikey and you're done. You can even use Resident Keys mode (if your key supports it) to avoid having to carry the private-key-half around with you, you can load it straight from the Yubikey with `ssh-add -k`.

This is the only way that lets you walk up to a machine, plug your key in and SSH to your server securely with just two commands. The downside is that both sides have to be running SSH 8.2+.

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#15
post #14

I have been trying to use Yubikey for SSH over the years, and everything has been a huge hassle that just didn't work well enough. Everything, that is, until SSH 8.2 came out. Using a Yubikey (or any other U2F-compatible key, which is a lot of them) is a breeze: Run `ssh-keygen -t ecdsa-sk -f ~/.ssh/id_ecdsa_sk` to generate a key from your Yubikey and you're done. You can even use Resident Keys mode (if your key supp…

Can you register multiple devices for the same SSH key, so you have a backup in case one gets lost or breaks?

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#16
post #15
post #14

I have been trying to use Yubikey for SSH over the years, and everything has been a huge hassle that just didn't work well enough. Everything, that is, until SSH 8.2 came out. Using a Yubikey (or any other U2F-compatible key, which is a lot of them) is a breeze: Run `ssh-keygen -t ecdsa-sk -f ~/.ssh/id_ecdsa_sk` to generate a key from your Yubikey and you're done. You can even use Resident Keys mode (if your key supp…

Can you register multiple devices for the same SSH key, so you have a backup in case one gets lost or breaks?

No, but why do you need to? Just add multiple keys to all hosts.

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#17
post #15
post #14

I have been trying to use Yubikey for SSH over the years, and everything has been a huge hassle that just didn't work well enough. Everything, that is, until SSH 8.2 came out. Using a Yubikey (or any other U2F-compatible key, which is a lot of them) is a breeze: Run `ssh-keygen -t ecdsa-sk -f ~/.ssh/id_ecdsa_sk` to generate a key from your Yubikey and you're done. You can even use Resident Keys mode (if your key supp…

Can you register multiple devices for the same SSH key, so you have a backup in case one gets lost or breaks?

Why not just add the keys from each device to your machines? Doing secure key transfer between hardware tokens is way more complicated.

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#18

Earlier quoted context omitted.

Thank you very much for the link, I missed that discussion. I had no idea the security of OnlyKey was so terrible, in light of this I will stop recommending it.

I'm really excited about the next SoloKey coming out soon.

Thank you for the alternative. Sadly it doesn't support SSH or GPG keys, does it? That was one of the selling points of the OnlyKey for me (and it being open source of course).

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#19
post #8

Is it considered good practice to create the key on the yubi and not have a backup? Or alternatively a master key to sign the key on the yubi so you can create a new subkey if you lose the yubi?

Ideally each key will be generated on the device and be unexportable. That's a major part of the value of a Yubikey/smartcard/HSM, because it provides Non-Repudiation, and it enables you to be reasonably certain that it is impossible for the key to exist outside of the physical device.

You can use multiple devices to generate multiple keys to give you persistent access in case a device fails or is lost. Software generally accommodates multiple (public) keys per client for this reason.

With an SSH CA, the server ultimately trusts the CA key, and client keys are used for authentication via the client certificates. I think you can use Yubikeys and relatively inexpensive HSMs (eg. Nitrokeys) for this.

https://framkant.org/2016/10/use-a-smart-card-or-hsm-to-secu...

Re: Show HN: Yubikey-agent – an easy to use Go ssh-agent for YubiKeys

#20

Earlier quoted context omitted.

I'm really excited about the next SoloKey coming out soon.

Thank you for the alternative. Sadly it doesn't support SSH or GPG keys, does it? That was one of the selling points of the OnlyKey for me (and it being open source of course).

I'm not sure if they will support those yet. I could never get SSH working well, whereas SSH with U2F works perfectly (and they do support that). I'm guessing they will add GPG key integration, as once the key can perform crypto operations, it's just a matter of host software.
Post reply on HN