PDA

View Full Version : How to add my user in sudoers ?



goxi
11th February 2009, 02:35 PM
In Ubuntu I was able to do sudo commands with password confirmation, Fedora says that I am not in sudoers list. How to add my self to that list.

keatonvictor
11th February 2009, 03:10 PM
Hi goxi to add a user to /etc/X11/sudoers you need to do the following

Switch to root


su -
TYPE ROOT PASSWORD

Enable writing to file


chmod a+w /etc/X11/sudoers

Open the file


gedit /etc/X11/sudoers

Find the line that says

ROOT ALL=(ALL) ALL
under that line add the line
username ALL=(ALL) ALL

so if you username is goxi it would look like this..

root ALL=(ALL) ALL
goxi ALL=(ALL) ALL

Once you have changed the file, save it and close it. then remove write permission from file or you will get errors.


chmod a-w /etc/X11/sudoers


exit root shell


exit


now try using sudo and all will be golden

Hope that helps

vallimar
11th February 2009, 04:12 PM
Don't mess with chmod'ing and such, use the command (as root) visudo.
It's purpose is to allow secure and proper editing of the sudoers file.

The alternative method, is to enable the 'wheel' group as alternative root members.
Then add whatever users you want to the wheel group. If you aren't going to put
restrictions on indivuals, it's cleaner then adding them one at a time.

axel
11th February 2009, 09:56 PM
Check this: Fedora sudo (http://www.my-guides.net/en/content/view/125/26/1/1/#sudo)

glennzo
11th February 2009, 09:59 PM
As root, echo 'glenn ALL=(ALL) ALL' >> /etc/sudoers works every time.

scottro
11th February 2009, 11:57 PM
What if his username isn't glenn?

(SOMEONE has to ask these questions)

glennzo
11th February 2009, 11:58 PM
What if his username isn't glenn?

(SOMEONE has to ask these questions)Scott! You funny guy! If his user name isn't glenn then he's bummin'. :)

goxi
12th February 2009, 12:14 AM
Thanks , it worked for me :)

daviddoria
12th February 2009, 01:26 AM
Didn't I hear in F11 that you won't have to do this anymore? As an attempt to make linux friendlier for beginners?

NoEffex
12th February 2009, 01:33 AM
Didn't I hear in F11 that you won't have to do this anymore? As an attempt to make linux friendlier for beginners?

I wouldn't be surprised if Anaconda or the firstrun thing did it for you, as that wouldn't necessarily be a hard thing to implement. So long as the kernel is booted, just use some io functions, seek to the end, then write(ghetto way of course, but just an example of how it could be implemented easily).

scottro
12th February 2009, 02:24 AM
Hrm, I didn't check on the one F11 I have. I just did my usual add to sudo imediately.

I hadn't heard that though. (Doesn't mean it isn't there, I might have easily missed it.)

shahdharmit
21st May 2009, 01:04 PM
Thanks axel. It worked.