News for hackers. Stuff that matters.
Re:Using a Yubikey as smartcard for SSH public key authentic... by drexlspivey on Friday March 08, 2019 @06:58PM (#19343416)
If you own a MacBook Pro with Touch Id I highly recommend https://github.com/sekey/sekey. It generates ssh keys in the secure enclave (mini HSM chip) and allows you to login to remote machines with Touch Id. The key can never leave the secure enclave.
Re:Using a Yubikey as smartcard for SSH public key authentic... by gleenn on Friday March 08, 2019 @07:15PM (#19343517)
That sounds awesome, but isn't that risky? Doesn't that mean you could never make a backup of the key, so if your macbook broke then you'd permanently lose access to whatever the key was protecting?
Re:Using a Yubikey as smartcard for SSH public key authentic... by saltcured on Friday March 08, 2019 @07:37PM (#19343641)
The solution is not to make backups _of_ a key, but to make backup keys and enroll more than one in authorization lists.

This also helps immensely when you want to retire a key, whether due to loss of control or concerns about its strength in the future. Being in the practice of having a set of authorized keys, you can safely remove older ones from authorization lists without locking yourself out.

Re:Using a Yubikey as smartcard for SSH public key authentic... by jasonjayr on Friday March 08, 2019 @10:40PM (#19344300)
I should make a patch instead of wishing, but it'd be nice if there was a ~/.ssh/authorized_keys.d/ directory where you could drop lists of keys, instead of trying to merge in changes to the one file ...
Re:Using a Yubikey as smartcard for SSH public key authentic... by yjftsjthsd-h on Friday March 08, 2019 @11:04PM (#19344372)
It's kinda ugly, but you could do this by putting `Include config.d/*` at the top of your ~/.ssh/config in order to make ~/.ssh/config.d a thing (LPT: do this anyways; it's a huge quality of life improvement), then dropping in config files to point at keys.
Re:Using a Yubikey as smartcard for SSH public key authentic... by swinglock on Saturday March 09, 2019 @01:12AM (#19344769)
This is already solved, use ssh-copy-id.
Re:Using a Yubikey as smartcard for SSH public key authentic... by sowbug on Friday March 08, 2019 @09:16PM (#19344041)
It's a change in mindset to treat SSH keys as unique, non-duplicatable physical objects, but it's very comforting to be able to reason precisely about the whereabouts of a given key.

It does mean you have to get better at keeping your public key lists up to date, so that revoking a key doesn't need a bunch of manual steps. But that's something Ansible/Chef/Puppet are good at.

Re:Using a Yubikey as smartcard for SSH public key authentic... by yjftsjthsd-h on Friday March 08, 2019 @11:05PM (#19344376)
Also worth looking at using a SSH cert-authority, if this is a usecase you're optimizing for.
Re:Using a Yubikey as smartcard for SSH public key authentic... by linkregister on Friday March 08, 2019 @11:34PM (#19344477)
Unfortunately, Github among other providers are still in the dark ages and don't recognize ssh certificates. You have to install each key as it's issued.
Re:Using a Yubikey as smartcard for SSH public key authentic... by m-p-3 on Saturday March 09, 2019 @01:48PM (#19347731)
Exactly. I use SSH a lot and everytime I have a new device, I'll generate a new key and upload the public key to my servers.

I make sure to use good labeling to know which key is on which device (user@hostname) to deprecate them when they get decommissioned.

Re:Using a Yubikey as smartcard for SSH public key authentic... by ecesena on Friday March 08, 2019 @11:25PM (#19344446)
Totally second this. A secret copied is no longer a secret.
Re:Using a Yubikey as smartcard for SSH public key authentic... by drexlspivey on Friday March 08, 2019 @07:38PM (#19343650)
Yes if your MB broke the key is lost but you can always add multiple keys to the remote machine in case that happens.