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 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. Since changing the default file permissions was the last change I guess it may be related to that, but I am not sure why that could be an issue.

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?

Thanks!

share|improve this question

1 Answer 1

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

 
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.