LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Adding My Name To Sudo In Fedora Core 6, I Have Unlucky Tries (https://www.linuxquestions.org/questions/linux-software-2/adding-my-name-to-sudo-in-fedora-core-6-i-have-unlucky-tries-513442/)

aaron4katie 12-24-2006 03:49 PM

Adding My Name To Sudo In Fedora Core 6, I Have Unlucky Tries
 
Firstly can someone tell me what visudo is, is it just typing the command vi and then locating the sudoers file like this...

Code:

vi /etc/sudoers
because that is what I have been doing, as root of course but I cannot get my username called Aaron, to even use the sudo command, it asks for the password but once entered it says Aaron is not in the sudoers file.

I've tried adding or removing different things in the file but I still can't use it using Aaron, root can use it fine without asking for password.

I'm sure that it wasn't just a capital letter problem or a typo. It's annoying using the su command just to install something via yum. I know how to save the file .. :w.

Anybody help in newbie English or something?

PS: I've looked at instructions via google search and these forums but no luck.

b0uncer 12-24-2006 03:55 PM

You're editing the file correctly. In addition to editing the file you might also need to add your user to the group called sudoers, either using some graphical tool or by editing file /etc/group (the file's contents should show you how to do that).

Instead of adding that single user to the sudoers file, you could as well let some specific group be able to use sudo (usually a group called wheel) and then add your user to that group. I think this is the preferred method. Usually the file /etc/sudoers already contains a line that lets users in wheel group use sudo, one just has to uncomment the line (take #-mark out of the line's beginning). The file should contain some examples which you can base this thing on, if the file doesn't already have a line for wheel group. The line just contains the group name and the word ALL twice (to let the users in that group access all commands with password used; there's a special nopass option to let use sudo without password, but don't do that if you don't know exactly what you're doing). Manpage of sudo also contains all the relevant information.

So:

1) edit /etc/sudoers and uncomment or write a line where users in a specific group (preferred this way, not just single users) can access sudo (ALL:ALL)
2) edit /etc/group and add the user into the groups sudoers (if it exists; if not, you may have to create it, but not always -- depends on your distribution, refer to the manpage of sudo) and the group you added to the sudoers file (usually wheel).

macemoneta 12-24-2006 05:21 PM

You should not be editing the sudoers file directly. You should use the visudo command, as syntax errors will cause the sudo command to ignore the entries. See 'man sudoers' and 'man visudo'.

aaron4katie 12-26-2006 06:23 AM

I added the wheel file to sudoers and that didn't help me, but I went to administration and then users and groups and added my username to the wheel group, so I'm ok now.


All times are GMT -5. The time now is 09:41 PM.