Adding user to sudoers
Somebody asked why adding a user to the wheel
group in Oracle Enterprise Linux didn’t enable them as a sudoer, as qualified in my earlier Fedora post. The reason is that you also need to modify the /etc/sudoers
file to specify users allowed that privilege (and the file differs from it’s Fedora cousin). If you have the root
user privileges, you can do the following:
- Change to the
root
user account withsu
, and provide the password when prompted. The syntax is:
su - root |
- You can find the line you need to change with this command:
cat /etc/sudoers | grep %wheel |
#
comment. If you don’t want authorized sudoers to provide a password, modify the second line by removing the #
comment. Open the /etc/sudoers
file with vi
or gedit
if you’d like a GUI editor.
# %wheel ALL=(ALL) ALL # %wheel ALL=(ALL) NOPASSWD: ALL |
Hope this helps, I’m off to Oracle Open World 2011 tomorrow.
Quick update for Fedora 20, you su
to root
and add your user to the sudoers
list with the following syntax:
usermod someusername -a -G wheel |
By the way, don’t forget to log off and then back on to the account.