Protecting SSH Keys with macOS Secure Enclave
Using macOS’s Secure Enclave to store SSH keys promises stronger protection against key theft, since the private key never leaves hardware and each operation can require Touch ID. Commenters weigh this against significant trade-offs: lack of portability and backup, macOS-only tooling, prompt fatigue, fragile system APIs, and the risk of being locked out if Apple changes undocumented behavior. Alternatives such as YubiKeys, 1Password’s SSH agent, TPM-backed keys on other platforms, and traditional passphrase-protected files are compared, with no clear consensus beyond the need to balance security, usability, and cross-platform needs.
Secure Enclave for SSH: Appeal and Concerns
- Many like the idea of SSH keys that never leave hardware and require Touch ID, reducing the risk of keys being copied from disk or backups.
- Others worry macOS’s native Secure Enclave SSH support is undocumented and could change or disappear, potentially locking users out.
- Consensus: treat Secure Enclave keys as device-bound and disposable; always keep backup access (other keys, tokens, or methods).
Tools and Approaches
- Secretive is widely praised as a friendly wrapper around Secure Enclave keys with per-key policies and better prompts than the native flow.
- sekey-sh, Termius, Windows Hello/TPM-backed
ed25519-sk, and various agents (including Tailscale-based and TPM/Win-specific ones) are mentioned as alternatives. - Some prefer 1Password (or similar) to centrally store and share SSH keys across machines, accepting that this means shared private keys.
Portability, Cross-Platform, and Lock-In
- macOS-only solutions are seen as a step back for users who also work on Linux/Windows; they reintroduce normal file-based keys elsewhere.
- Hardware tokens (YubiKey, TKey) and device-specific keys synced to servers are favored by some as vendor-neutral and physically portable.
- Importing existing keys into Secure Enclave is generally not possible, which some find limiting.
Usability, Prompt Fatigue, and Agents
- Touch ID on every Git operation or commit signing can cause “fingerprint fatigue,” pushing some back to cached or file-based keys.
- 1Password’s SSH agent prompts can be spammed by tools and AI coding agents, making people default-approve or disable it.
- Complex setups around ssh-agent, forwarding, multiplexing, and dev containers remain fragile and configuration-heavy.
Reliability and macOS Security APIs
- Multiple reports of macOS keychain and security APIs being brittle, poorly documented, and prone to silent data loss or strange behavior (e.g., WireGuard configs disappearing).
- Lack of smooth bug-reporting channels (mailing lists instead of issue trackers) further discourages users from relying on such integrations.
Security Model Debates
- Some argue traditional passphrase-protected keys plus agents are “good enough”; others stress that SE/TPM keys plus user presence are closer to real 2FA.
- Critics note that if malware can run as the user, it can still abuse the “signing channel” even if it can’t extract the key.
- Discussion surfaces about PATs vs SSH keys, token lifetimes, IP restrictions, and the limited but real incremental gains of hardware-bound keys.