I am fairly new to managing my production server and I had some problems accessing my EC2 account with the RSA HOst key for xxx has changed message. I read on a couple of Blogs that by simply deleting the known_hosts in the /root/.ssh/ folder the system would automatially generate the keys the next time i attempt to log in.

Now I deleted the file while I was logged in as Root and the file does not seem to appear. Is there something I need to do. Im not fully aware of what the known_hosts file does. From what I read it maintains key pairs identifying hosts connecting from remote machines. I appreciate any help on if I need to do something to recover that file or is it safe?

link|improve this question

This doesn't belong on SO. Move to ServerFault? – Frank Shearar Mar 8 '10 at 12:20
this one is for serverfault. – Rook Jul 22 '10 at 18:44
feedback

migrated from stackoverflow.com Jul 23 '10 at 4:26

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 1 down vote accepted

It should create a new one automatically. You can always just touch a new one and then set permissions/ownership as needed (based off another one perhaps). I usually just remove the entries from known_hosts that are wrong and not whack the whole file.

Oh, and this belongs on SuperUser... :-)

link|improve this answer
feedback

root's known_hosts file doesn't get involved unless you're sshing as root — that file is generated and used by the client. You're looking for the .ssh/known_hosts file in the home directory of the account you're sshing from.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.