Thursday, October 10, 2013

How Give a User sudo Power?

This post demonstrates how to add a user to the sudoers list on a Linux Operating System.

1. Open a terminal and login as the root user.
su root

2.Open  the "/etc/sudoers" file or execute "visudo".
vi /etc/sudoers
visudo #The same as the command above

3. Add a new line below the root user.
Format: <username> ALL=(ALL)       ALL
## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
##      user    MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
oracle ALL=(ALL) ALL

4. Save the file. Now your user should have root privileges.
sudo [command]

No comments:

Post a Comment