Setting up SSH keys on macOS with Touch ID

51 points by nmattia


msangi

To make it a bit less tedious adding back the key after a reboot I export SSH_SK_PROVIDER=/usr/lib/ssh-keychain.dylib so that I only need to type ssh-add -K

eta

Cool! I personally use Secretive for this but I had no idea you could do it all with OS-provided tooling.

nmattia

Post author here. This was the result of a lot of experimentation; if there are experts that want to chime in, I'd love to hear your thoughts!

bityard

Thanks for writing this, I will have to try it out. I only skimmed the article because I'm not familiar with a lot of the secure enclave/Apple-specific stuff, but I have a question: Does this setup require biometric authentication every time the key is used, or does the system "remember" your authorization for some length of time?

When I use regular SSH keys on my desktop machines, I typically set the SSH key passphrase to be the same as the login passphrase and then configure the OS/desktop to unlock the SSH key automatically on login. This is reasonably secure and very convenient, especially since I often connect to various hosts through automation. (SSHFS, Ansible, etc.)

atmosx

Cool stuff.

Key management depends on how you use your setup I suppose. I share SSH keys between machines, so in my case 1Password handles it nicely, but there are drawbacks as well (e.g. some systems are not well supported).

I can see plenty of reasons to go one key per laptop though, but since I use roughly 3 different Apple laptops and ~5 systems (in total) that I want to be able to SSH from, and the targets number is 10+ (RPis, Linux boxes, routers, etc.), key distribution becomes a real pain for me.