Ubuntu: Create new user with sudo access
Posted on December 12th, 2010 in Ubuntu | No Comments »
Objective: Create new user on Ubuntu with sudo access
Create New User
$ adduser username Adding user `username` ... Adding new group `username` (1000) ... Adding new user `username` (1000) with group `username` ... Creating home directory `/home/username` ... Copying files from `/etc/skel` ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for username Enter the new value, or press ENTER for the default Full Name []: Username Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y
Add to sudoers file
$ visudo
Add (change username to your username):
username ALL=(ALL) ALL
Under:
root ALL=(ALL) ALL
Thats it. This new user can only do superuser commands via sudo. One thing I am still not sure of is how to do is restrict this user from cd ..‘ing back up and snooping around other directories. If you know how, please let me know. For now, I can continue setting up my test server.