Link to home
Start Free TrialLog in
Avatar of burnedfaceless
burnedfaceless

asked on

Transferring SSH Keys to another machine

When I reinstall Ubuntu I was going to move my SSH Keys to that machine.

They are GPG encrypted and stored on a USB Drive that is Luks encrypted.

When I reinstall Ubuntu can I just decrypt id_rsa and id_rsa.pub and move them into

~/.ssh/

Open in new window

?
ASKER CERTIFIED SOLUTION
Avatar of Dimitris Maleas
Dimitris Maleas
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of burnedfaceless
burnedfaceless

ASKER

Thanks
Also look at ssh-copy-id docs, which is the ssh suite tool designed for this.
I'm not putting a key onto a server. I'm transferring my keys from one Desktop computer to another.

I use pass to manage my passwords. Pass uses Git to synchronize .gpg encrypted passwords between devices.

I keep my SSH and PGP keys on a luks encrypted USB drive on my keychain (and two backup encrypted drives in a safety deposit box). The PGP and SSH keys are password encrypted with GPG using a very long password I memorized that's different from the USB password :)

For years I reused passwords but I have been in heaven. And I think it's more secure than most commercial password managers.

That's basically why I asked that question...I don't want to get locked out of everything when I need to reinstall Linux :)
Reinstalls are a bit different.

If you do a full reinstall (not update, actually destroy all data), then you'll simply login to machine/container, then copy over your keypair to new machine.

You can do this using vi with cut & paste, or any other file copy method.

Tip: Always use a descriptive key name, like backups.rsa or burnedfaceless.rsa, as using the default key files can be very tricky if these are ever accidentally over written.