[SOLVED] How to add a user to sudoers in Ubuntu Linux

FREQUENTLY ASKED QUESTIONS (Ubuntu)
Q: How to add a user to sudoers in ubuntu linux?

Adding a user to sudoers will allow the user to run commands as root privileged. That user can run the commands as root with the command sudo and it will prompt you to type the user's own password. First you need to create a normal user in your ubuntu box. then follow the steps below..


This is how you denied without being a sudoer
james@ubuntu:~$ sudo /etc/init.d/networking restart
james is not in the sudoers file.  This incident will be reported.


Add a user to sudoer group
Go to the terminal and login as root or a root privileged user
root@ubuntu:~$ visudo
           OR
user@ubuntu:~$ sudo visudo

# Now find the line look like:         root    ALL=(ALL) ALL
#Just below the above line add the new user as a sudoer
#If the username is "james", and you need to add "james" to sudoers add as below
james    ALL=(ALL) ALL
# Now press Ctrl+x and then press y  (to save the changes)
Note: Now the user will have all the priviledges of the root user(full control on the system).
Click on screenshot to enlarge
Now login as the new user and test the sudo permissions
james@ubuntu:~$ sudo /etc/init.d/networking restart
[sudo] password for james:                           (enter user james's own password)
* Reconfiguring network interfaces...                                   [ OK ]

0 comments:

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons