Grant sudo powers in RHEL/CentOS

Running as Root all the time is a dangerous tactic in a Unix based system, yet some commands can only be executed with superuser privileges. The sudo command allows a regular user to run selected commands with superuser privileges. This feature is included by default in Red Hat Enterprise Linux and CentOS systems, but it takes an extra step to get it working.

First you need to gain superuser privileges. Next, open the file located at /etc/sudoers. You need to locate the line that reads:

# %wheel ALL=(ALL) ALL

Now uncomment it by removing the hash mark (#) from the beginning of the line so it looks like this:

%wheel ALL=(ALL) ALL

Save a close the file. Now anyone who is a member of the wheel group will be able to use the sudocommand. To add a user to this group, gain superuser priviliges and run this command:

/usr/sbin/usermod -aG wheel [username]

This will add the specified user to the wheel group, allowing that user to use the sudo command.

QUoted from: http://blog.zloether.com/2009/05/grant-sudo-powers-in-rhelcentos.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s