Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Why would I get a "Permission denied: connect" while trying to ssh to an amazon instance? I'm using the same key pair that works with other instances in my account. Only this new instance I just created doesn't allow me to ssh.

share|improve this question

Check /var/log/secure, it'll usually give you an idea of what could be the problem with SSH.

Were both instances created with the same keypair?

You're trying to ssh as ec2-user?

share|improve this answer
same keypair. user was ec2-user. i deleted the instance and created a new one and was able to login with the same keypair. will check /var/log/secure the next time it happens. Thanks. – aldrin Jun 5 '12 at 9:56
up vote 0 down vote accepted

This has occurred only once more till now - when I attached a 64-bit volume to a 32-bit instance.

And earlier I am guessing the instance just got corrupted when I tried to shutdown tomcat manually (which btw you shouldn't do beanstalk)

Recreating the instance in both the cases sorted the issue (though it didn't let me recover the existing instances)

For want of any better answer, I will close this question.

share|improve this answer

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.