Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I created a new Amazon Linux AMI instance and could connect just fine via ssh. Then I assigned an elastic IP to the instance and ssh suddenly stopped working.

Debug output:

debug1: Trying private key: theduke.pem
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
share|improve this question
    
did you reboot? check that the instance didn't change at all. sometimes the machine name you ssh into will change when you make changes to your instance and reboot. You may need to recreate your keys. –  egorgry Feb 20 '11 at 23:57
    
I did not change anything and didn't reboot either. –  theduke Feb 21 '11 at 0:00

2 Answers 2

I experienced this myself and found there's a very simple answer. Patience. It may take up to an hour for the machine to be accessible via ssh, even when using the correct credentials and the new IP address. See this related thread about the topic where another AWS user goes over it with Amazon support:

https://forums.aws.amazon.com/message.jspa?messageID=95268

share|improve this answer
    
That thread says an hour is abnormal and that it should be no more than a few minutes. –  ceejayoz Feb 2 '12 at 18:50
    
In my experience, it too more than a few minutes. However, since I wasn't monitoring it continuously, I don't know exactly when the transition completed, but I did check it several times in the first few minutes. –  Mark Stosberg Feb 3 '12 at 14:37

Check associating an Elastic IP address with a running instance:

  • login in AWS Management Console
  • click EC2 tab
  • Instances in the Navigation
  • write down the instance ID
  • click Elastic IPs in the Navigation
  • select an instance and click Associate

Also check login when use ssh.

share|improve this answer

Your Answer

 
discard

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.