Not able to login to EC2 instance after making changes to default ec2-user

amazon ec2amazon-ami

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?

Thanks!

Best Answer

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!

Related Topic