Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm running a production-level Amazon ec2 instance, and I want to close out root privileges to all users. Normally, when one logs in to the instance as ec2-user, the ec2-user immediately gets sudo privileges, which I am trying to do away with in order to ensure security.

I was able to set a new password for the root user, and I went into /etc/sudoers to try and remove the ec2-user from sudo privileges, but that user isn't even listed in the file. Does anybody know how I can remove ec2-user from sudo privileges on an Amazon ec2 instance running the default linux installation?

share|improve this question
up vote 18 down vote accepted

Check /etc/sudoers.d/cloud-init file, ec2-user default user is there, just delete this file.

share|improve this answer
Worked like a charm, thank you! – Nicholas Finch Jul 5 '13 at 16:41
Would upvote you, but still need to increase my reputation :) – Nicholas Finch Jul 5 '13 at 16:41

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.