Score:0

replacing host keys in /etc/ssh

us flag

I have a backup of /etc/ssh from previous ubuntu installation. In new installation of Ubuntu I would need to place host keys from previous installation to the new installation Can I just copy those from previous installation to new one? And will I have to run chown?

Score:0
jp flag

I would say you can manually bring the host keys to .ssh folder but you need to ensure that the owner of the files is the unix user intended to use the keys and assign both public and private keys 600 permissions as you mention with: "sudo chmod 600 <<private/public key>>".

lunar75 avatar
us flag
Thanks Pedro. I think I will back up what's in /etc/ssh and in ~/.ssh/ move it back when reinstalling Ubuntu and chown files in /etc/ssh. It would be so much easier if it works. There would be no need to exchange the ssh keys all over again. My observation: Under /etc/ssh on my running Ubuntu I see the .pub files and ssh_import_id are 644 and the secret keys are all 600. owner is root, created by root.
Pedro Fernández Soler avatar
jp flag
you are right lunar :) Permissions for public key are also 644 in my setup, I hope it works! I have actually manually copied public and secret keys into EC2 AWS instances in this way and it worked ;)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.