User Management Privileges Adduser – Admin User Automatically Has Sudo Privileges

adduserprivilegesuser-management

I added a user named "admin" to my Ubuntu 14.04LTS server, using adduser.

I'm used to having to add a user to the /etc/sudoers file when adding a new user that needs sudo privileges, but this time I didn't. It doesn't appear the 'admin' user existed before I created it, based on the output in the shell. Why did this work this way?

Best Answer

By default adduser adds every new user to a group with the same name as the user's (the group is created if it doesn't already exists). So if you create a user called admin it will be added to the group admin.

/etc/sudoers contains the line

%admin ALL=(ALL) ALL

which means that all members of the group admin are allowed to use sudo - and that's true for your admin user, too.

Related Question