Fedora – Add User To Sudoers

Pretty simple and quick way to add a user to the sudoers list in fedora:

Login as root user:
su
Password: *enter root password here*

Add write permissions to the sudoers file:
chmod +w /etc/sudoers
Add the user (change alex to the user you want to add to sudoers) to sudoers and set no password (so you don’t have to enter a password when using sudo).
echo '<strong>alex</strong> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
Remove the write permission from the sudoers file once you have finished writing to protect it, and then exit:
chmod -w /etc/sudoers
exit

Now try testing it out by checking for updates or anything else you need to do as root :-)

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>