← Tue, Nov 10 digest

I deleted all my SSH keys

read article ↗ hn thread ↗

Transitioning entirely away from traditional on-disk SSH private keys by leveraging hardware-backed security modules like YubiKeys, TPMs, and Apple's Secure Enclave.

read it It provides a clear, practical guide with exact commands for migrating SSH keys to YubiKeys, TPMs, and Apple Secure Enclave.

summary

A complete migration from traditional on-disk SSH private keys to hardware-resident credentials can be achieved using three distinct methods: FIDO2-backed YubiKeys, TPM modules via ssh-tpm-agent, and Apple's Secure Enclave on macOS Sequoia. Each approach is evaluated for real-world usability, presence-detection requirements, and unattended automation scenarios. While eliminating vulnerable on-disk keys improves security against exfiltration, the trade-offs include hardware dependency and recovery risks.

key points

  1. FIDO2 ed25519-sk keys on YubiKeys store handles on disk while keeping the private key entirely non-exportable in hardware.
  2. TPM-backed keys use ssh-tpm-agent to decrypt an encrypted key file on disk using the platform module, though unlike YubiKeys, encrypted key material still rests on storage.
  3. macOS Sequoia natively supports Secure Enclave SSH keys via sc_auth and dynamic library keychain integration, requiring Touch ID for operations.

who should read it

Sysadmins, developers, and security-conscious engineers looking to eliminate plain-text or passphrased private keys from their local disks.

discussion mixed

consensus

Most participants agree on the security benefits against key exfiltration, but heavily debate the practical risks of hardware failure, travel loss, and recovery friction.

pushback

A minority view maintains that traditional passphrased keys managed via ssh-agent suffice for most threat models without introducing brittle physical failure points.

best comment by JayGuerette ↗

Before anyone commits to this: pretend either you lost a physical device or it had some sort of hardware failure and try to regain access from whatever providers you had keys with. You will have some success and some failure. You will mostly likely rethink this path.

It highlights the critical real-world friction of hardware keys: recovering access after losing a physical device or experiencing hardware failure.

Generated by an LLM from the article and thread. Check the sources before relying on it.