How to backup and restore ssh keys on Linux

on Michael Harley's blog

1 min read

I just reloaded the OS on my little System76 box and I stumbled around a bit when trying to restore my ssh keys. Here is a note for myself but maybe it can help someone else too.

Backup #

I've written about how I backup my computer and I include my ssh keys in this backup.

Restore #

Copy all files from the previous ~/.ssh directory to the new ~/.ssh directory then execute the following commands:

chmod 400 ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_ed25519
ssh-add

You're welcome future self.

Filed under: Note To Self, Linux, ssh
Michael Harley

About the author

Hello, I'm Mike. I care about the IndieWeb, digital sovereignty, and the open web. I'm a developer and team lead based in Richmond, VA, and this site is my corner of the internet.

Directory: /home · /about · /contact · /posts · /sitemap