Don't keep your SSH keys on disk
Johanna Larsson explains how to migrate SSH private keys off your local disk and into Bitwarden using its built-in SSH agent to mitigate exfiltration risks.
summary is enough The article offers a straightforward guide to using Bitwarden as an SSH agent, but the comment thread contains much richer debates on threat models and hardware security keys.
summary
Moving SSH private keys off disk and into Bitwarden to use its integrated agent prevents malicious local code from directly exfiltrating raw files. The configuration balances security with vault unlock intervals and biometric prompts, alongside steps for setting up Git commit signing. Commenters expand on this by debating the limits of software-based password managers against local malware and offering alternatives like YubiKeys or short-lived SSH certificates.
key points
- Storing private keys in a password manager and exposing them via an SSH agent prevents local code from directly reading raw key files off disk.
- Bitwarden's SSH agent integrates with system global configs to handle keys seamlessly while respecting vault unlock timeouts.
- Modern Git supports SSH-based commit signing, allowing developers to cryptographically sign commits using a dedicated SSH key.
who should read it
Developers looking to reduce their local security attack surface by moving credentials off disk.
discussion mixed
consensus
Commenters agree that moving keys off disk improves security against basic file-scraping malware, but debate whether software password managers offer enough protection against sophisticated local processes or rogue AI agents running as the user.
pushback
A vocal minority argues that hardware tokens like YubiKeys or short-lived SSH certificates are superior because keys never reside in software memory.
While in theory, this adds at least some small layer of protection, I have doubts that it adds anything meaningful to stop a smart attacker.
The problem here is that everything is running as your user, so it's all the same security sphere.
You may be thinking, "But Bitwarden requires me to approve each key request". Problem is that if the attacker is already running as your user, which I'm assuming here because to steal your bare keys, they'd already need to be. This means they can also hit the approve button for you.
Ok, now you say "But it requires touchID!". Maybe that gets you just a …
It provides a realistic threat-modeling critique of software-backed SSH agents, noting that malware running under the same user account can often bypass prompt confirmations or hook into memory.
Generated by an LLM from the article and thread. Check the sources before relying on it.