Switching distros and ssh keys for vps access

I will be switching distros in the future (maybe 1 month or so) and I understand that you can copy the information from the home folder and pretty much you will have all of your pertinent data (if I am wrong, please correct me). I am not as concerned about configurations as I am about my information.

My concern is mostly related to ssh key data. I have a vps that I setup with a stored key combination (hopefully I am phrasing this correctly) and I want to be sure that I can have the same setup when I change distros so I can access this server. Also, I am not 100% sure that I remember (or stored) the key phrase that I used to set up the key (I have not looked…I may have it somewhere).

Any advice for all of this would be greatly appreciated. I have been using Linux for less than 1 year (I am still a beginner…be gentle :grinning:)

@diamondre, from my experience (Linux PROs please check if I am right…),

  • make sure to copy ~/.ssh/ directory (though you should have it if you are saving your Home directory (should have all of the users listed under Home).
  • make sure to give the exact machine name like uid@machine. (you can find at the end of the ~/.ssh/id_rsa.pub file)

And just a side note, for PopOS, during installation, I can’t change @pop-os for my machine name… perhaps the PROs here can help if you are going with PopOS.

Also, for browsers, might want to find how to save the settings/profiles and save them on their own, for some reason they can’t catch it from the saved Home dir…

Hope this helps!

Thanks for your response. I do plan to backup everything (including the hidden files) in the home directory onto removable media.

I also noticed the .ssh folder and thought if that folder existed in my new distro install that I would be good, but as a level of comfort I thought it would be wise and prudent to ask before I jump in. I will verify the machine name as suggested.

The distro will more than likely be Fedora.

Please do come back with an update after the migration, I’d be interested to learn from your experience.

Good idea. I will share my experience after the migration.

1 Like

Yesterday I successfully transitioned my laptop. This did not go without an ssh hitch, but, it was not terrible. I do not know if I did not copy the files necessary for the ssh to function properly for my vps & my nextcloud server, but, I am able to login into each via ssh. The part that did not function was the key storage for me to access each server without a password. If I am thinking about this correctly, there were more files that should have been copied other than my home directory to allow for this to function properly. I will move forward and just perform the ssh copy keys for each server from scratch (as if for the first time…which it is for this setup).

I think you are right… I did miss something… sorry about that, it has been a while since I did it…

Other than the entire ./ssh files… I think I needed to copy the keys to the servers before I could use the same passphrase for password less login…
ssh-copy-id root@xxx.xxx.xxx.xxx

But I see you know what to do here, thank you for sharing your experience and your solution. If I have to do this again, I will be coming back here to refresh my memory! :sweat_smile: