What is the best way to backup an SSH key in case my hard drive fails, etc?

Super User Asked by SidedTech on December 6, 2020

I have disabled root user login for my CentOS server running cPanel. This is frustrating, as I then cannot login via SFTP and get to my root files on my server to check error logs (which I frequently have to do).

So I decided to just re-enable root login and set up SSH as it seems that this is very secure, but it seems this will create a key on my computer that once lost, I will not be able to retrieve, and could possibly lock me out of my own server forever (I may be mistaken on this).

So if that’s the case, I would need a way to back up my keys on a flash drive or a Dropbox or something. This way if I reinstall Windows (which I do all the time because it’s fun) or lose my data somehow, I can just get back to work without a workaround, if there even is one.


One Answer

What is the format of the key you have?

If it is a using the OpenSSH format (and not putty) then it is probably a plain text file. Just copy the text into a secure note in lastpass or whatever password manager you use. If key key is in some binary format, you could just base64 encode it and store it somewhere.

Heck, you could print it out even, though it would be a pain, if you ever had to manually retype it.

If you do choose to store a copy on the cloud, you should be certain that you have set a strong pass-phrase on the key so that it is encrypted.

Answered by Zoredache on December 6, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP