FG
💻 Software

How to store SSH keys?

Fresh7 days ago
Mar 15, 2026111702 views
Confidence Score1%
1%

Problem

I've started using SSH keys instead of passwords just recently (thanks to GitHub, of course), so please keep in mind that I'm pretty new to this whole concept. Currently my keys simply lie under ~/.ssh, but I'm not sure if this is a good practice. E.g. if I have multiple machines, I'd need to duplicate my private keys, which I think is undesirable. Or, if my HDD goes kaput, then I'll lose those keys, which (I guess) is undesirable as well. So, what are best practices on storing SSH keys securely, conveniently, and reliably? Seems like using a smartcard is an option (see Smartcards for storing gpg/ssh keys (Linux) - what do I need?), is this the best one? Update: The reason for the question was that many services (like GitHub, AWS EC2) provide guides on how to set up SSH keys for using the service, but little to no background (like, what to do if you already have a key generated by [1], what are recommended security measures). And it's unclear whether that info is in fact unimportant, …

Error Output

ssh-keygen

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to store SSH keys?

Low Risk

E.g. if I have multiple machines, I'd need to duplicate private keys, which I think is undesirable. No, actually you don't. If you have multiple machines, you just create a separate private key on each one. For each private key, just upload the corresponding public key to GitHub using the same process. Also, if my HDD go kaput, I'll lose my private key, which (I guess) is undesirable as well. Not really; if you lose your private key, just generate a new one and upload the corresponding public k…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment