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

Amazon EC2-instance: I made a user 'admin' and copied ec2-user's keys with proper permission. After successful login, i tried to do sudo su for root access, it says 'admin is not in the sudoers file. This incident will be reported.'

However i can do sudo su with ec2-user account and can gain root access.

What is sudoer file? how does ec2-user and admin different in config wise?

# useradd -m admin
# cp -R /home/ec2-user/.ssh /home/admin
# chown -R admin:admin /home/admin/.ssh

connect by putty: login as: admin Authenticating with public key "xxx" [admin@ip-xx-xx-xx-xx ~]$ sudo su

We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: 1) Respect the privacy of others. 2) Think before you type. 3) With great power comes great responsibility.

[sudo] password for admin:
admin is not in the sudoers file.  This incident will be reported.
share|improve this question
up vote 1 down vote accepted

You need to edit your sudoers filer and enable your admin user. You should only edit your sudoers file with the visudo command as this checks the syntax etc. Something like

admin    ALL=(ALL) ALL

will do. This allows your admin user to execute any command as on any host as any user after supplying a password.

Check the sudoers and sudo man pages

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.