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

I have been using key pairs to log in to my EC2 instance without any problems until I made some changes to the ec2-user.

I changed the group of the ec2-user (usermod) and changed the default file permission (umask), to give write permissions to the group.

I am not able to log in since this change. I get a "Server refused our key" error for the ec2-user.

The key has not been modified in any way. after changing the ec2-user permissions we are not able to login that is sure .

Has anyone faced similar issues? Are we not expected to change properties/permissions of the default ec2-user? How does one recover from this situation?


share|improve this question
up vote 1 down vote accepted

Loosing access to an Amazon EC2 instance is a common encounter - how to approach this situation when you don't know the reason yet is addressed in Eric Hammond's excellent summary Solving: "I can't connect to my server on Amazon EC2".

However, since you already now that the problem is permission related, you can apply his respective instructions Fixing Files on the Root EBS Volume of an EC2 Instance right away, see my answer to the related question Fixing Amazon EC2 Permissions for a short summary of this approach.

Good luck!

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.