Since I posted my 64 bit flash tutorial, I have been getting a lot of questions on how to enable a user to sudo on Fedora 10. For those of you that wanted it, here you go! Oh yeah, next time, RTFM. *grin*
Note that I am doing all of this from the command line. If you care to survive the Linux world, you should at least have a vague idea of how to use the command line. A terminal from within X will work fine as well for these steps.
Also note that this will work with MOST distros out there. I have yet to see a problem with any that I have tried, but I mostly work in the RPM world, so my exposure to other distros is somewhat limited.
Get logged in and open a terminal window if your system starts X automatically. If you need a tutorial on how to do that, google will be your friend for a while. Before we actually edit anything, we will be finding out what groups your user belongs to you will be looking for a couple of them that are quite important. “wheel” and whatever group mirrors your username.
[dude@computer ~]$ groups
dude wheel pulse-access pulse-rt pulse
[dude@computer ~]$
Once you are logged in and know what groups you belong to, you will edit “/etc/sudoers“. This will require you to be root to do this. (Type in “su” at the command prompt and enter the root password for the system when you are prompted.) Once you are root, enter the following command.
vim /etc/sudoers
Here is where those groups come in handy. If you had wheel listed, we simply have to uncomment a line. If not, we have to create a new line that includes your users’ group. It will make sense in a minute.
Lets start with the less likely situation that wheel was part of your groups list by default. You have two lines that you are looking for within sudoers.
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
It is quite simple at this point. If you would like to require that the sudo enabled users put their password in every time they run a command with sudo, uncomment the “# %wheel ALL=(ALL) ALL” line by removing the # at the start of the line. If you don’t wish to require a password for every use of sudo, do the same with the “# %wheel ALL=(ALL) NOPASSWD: ALL” line.
Now, what if you are like 99.9% of the fresh installs out there? What if you are not part of the wheel group, or have a situation where you only want your user to have sudo access? This is also very simple. Simply change “wheel” on whichever line you prefer to your group name and uncomment as before.
Done!
If you have issues using VI, there are a multitude of VI tutorials on the net. If you would rather use EMACS or nano or something, feel free. It should all work the same.