Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i copied a private AMI (lamp) over from a different account and created a new instance on ec2. the new instance has a new.pem key associated with it and i can see the title from AWS Management Console: Key Pair Name.

I've created a new.ppk file from new.pem. However when i log in SSH the new key does not work and the old.ppk key still seems to work.

how can i fix this?

would like to get rid of the old key and set new.ppk to be valid

should i follow this?

saw this article but found it confusing, it talks about logging in as root while also saying to disable root login

share|improve this question
found this and helped out!!!… – t q Mar 11 '12 at 3:50

Just remove the old key from '~/.ssh/authorized_keys' and paste in the new public key. Make sure the new key is in OpenSSH format and all on one line.

share|improve this answer
yes, what messed me up was that it seems to need 2 entries ... maybe its just my instance thats weird – t q Mar 11 '12 at 3:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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