LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2007, 03:24 PM   #1
usafitz
Member
 
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46

Rep: Reputation: 15
sudoers file error: owned by gid 10, should be 0


hey all, I've been on kind of a rant lately with permissions questions and I think I'm nearing the end. I've been trying to give one of my users sudo permissions so I put them in the wheel group and changed the sudoers file to reflect such. when I try to run anything under sudo, I get the following message. I looked around the forum for answers but can't really find anything. Can anyone help? thanks again.

sudo: /etc/sudoers is owned by gid 10, should be 0
 
Old 12-01-2007, 03:29 PM   #2
nowshining
Member
 
Registered: Dec 2007
Distribution: Ibex
Posts: 93

Rep: Reputation: 15
try this

sudo chmod 0 /etc/sudoers

edit: -->

adding: i think that's what it is referring to

http://www.mkssoftware.com/docs/man1/chmod.1.asp

Last edited by nowshining; 12-01-2007 at 03:30 PM.
 
Old 12-01-2007, 03:43 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Err ... chmod changes permissions not group ownership. Generally in Linux GID 0 is root and GID 10 is wheel. Try:

Code:
chgrp root /etc/sudoers
You may need to login (or su) to the root account as sudo may not operate if the permissions on /etc/sudoers are wrong.
 
Old 12-01-2007, 03:48 PM   #4
nowshining
Member
 
Registered: Dec 2007
Distribution: Ibex
Posts: 93

Rep: Reputation: 15
Quote:
Originally Posted by btmiller View Post
Err ... chmod changes permissions not group ownership. Generally in Linux GID 0 is root and GID 10 is wheel. Try:

Code:
chgrp root /etc/sudoers
You may need to login (or su) to the root account as sudo may not operate if the permissions on /etc/sudoers are wrong.
oh lolz didn't know that one, i was also thinking they were trying to sudo under the users they were trying to impliment.
 
Old 12-01-2007, 03:51 PM   #5
nowshining
Member
 
Registered: Dec 2007
Distribution: Ibex
Posts: 93

Rep: Reputation: 15
wait can't chmod change owner, i think i did that when i was deleting tmp folder and coudln't login due to insufficient error, in terminal the problem was seen as a permissions/allow error,, so i chmod 1777 tmp and then i was up and running, hmmm...i think i got myself confused now.. :/
 
Old 12-01-2007, 03:53 PM   #6
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Do not run the command in the previous post!

The /etc/sudoers file should be owned by root with -r--r----- permissions.

As root:
Code:
chown root:root /etc/sudoers
chmod 440 /etc/sudoers
If you want members of the wheel group to be able to run sudo commands add an entry in the sudoers file for them using visudo to edit (either via sudo or as root):

Code:
%wheel ALL=(ALL) ALL
Group to assign permissions Machine=(user to run command as) Command(s) to run

Damn, I was a bit slow with my typing!

Last edited by Disillusionist; 12-01-2007 at 03:54 PM.
 
Old 12-01-2007, 03:54 PM   #7
usafitz
Member
 
Registered: Feb 2004
Location: Albuquerque
Distribution: Fedora 9
Posts: 46

Original Poster
Rep: Reputation: 15
Sweet btmiller, that worked beautifully. So what I am seeing is that the file was not owned by root anymore for some reason. Wheel group owned it.

that being the case, if I am a member of wheel group, why wouldn't it work anyway. Is it because wheel group is lower on the pole than root?

thanks again for solving the problem.
 
Old 12-01-2007, 03:59 PM   #8
nowshining
Member
 
Registered: Dec 2007
Distribution: Ibex
Posts: 93

Rep: Reputation: 15
Quote:
Originally Posted by Disillusionist View Post
Do not run the command in the previous post!

The /etc/sudoers file should be owned by root with -r--r----- permissions.

As root:
Code:
chown root:root /etc/sudoers
chmod 440 /etc/sudoers
If you want members of the wheel group to be able to run sudo commands add an entry in the sudoers file for them using visudo to edit (either via sudo or as root):

Code:
%wheel ALL=(ALL) ALL
Group to assign permissions Machine=(user to run command as) Command(s) to run

Damn, I was a bit slow with my typing!
i myself thought i had it right, but i myself was following the error to change user to 0 but ahhh now i get what the error was saying darn it, OWNED BY USER 0 which is root, ahhh! root i mis-read the prompt but i was close i'll remember that the next time it comes for an asnwer or incase I myself have any trouble..
 
Old 12-01-2007, 05:08 PM   #9
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Quote:
Originally Posted by usafitz View Post
Sweet btmiller, that worked beautifully. So what I am seeing is that the file was not owned by root anymore for some reason. Wheel group owned it.

that being the case, if I am a member of wheel group, why wouldn't it work anyway. Is it because wheel group is lower on the pole than root?

thanks again for solving the problem.
IIRC, sudo checks the permissions of the sudoers file and if they are not what they should be, the program will refuse to work. This is meant to avoid situations where a careless admin would allow non-root users to edit sudoers and thus elevate their privileges.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error in sudoers file Julix Linux - General 9 09-07-2007 09:44 PM
Sound Server Fatal Error: Error - artsmessage: /tmp/mcop-root is accessible owned... m07hm4n Linux - Software 1 08-14-2006 01:01 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
uid, gid don't exist, yet files owned by them, i need to delete them mattie_linux Linux - General 10 05-05-2005 03:57 AM
Make a file owned by root owned by a user sharpie Linux - Newbie 2 02-26-2004 01:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration