"sudo" screwed

Forum rules
Before you post please read how to get help
Post Reply
blackcoatman
Level 1
Level 1
Posts: 13
Joined: Fri Jun 29, 2007 4:25 pm

"sudo" screwed

Post by blackcoatman » Sun Jul 01, 2007 6:46 am

Hello...

I needed to have a couple of applications run as root, but I didn't want to type a password. I found some info on how to do it, but it seems i did something wrong with the visudo command and now I can't run anything with "sudo". The output each time is this:

Code: Select all

>>> sudoers file: syntax error, line 21 <<<
>>> sudoers file: syntax error, line 22 <<<
sudo: parse error in /etc/sudoers near line 21
I can't even run Gnome's "Users and Groups". So, now I can't edit the sudoers file again. I tried with "su" but I don't know the password :P One solution would be to install windows on the other partition, install an ext3 driver and edit the file from there. But I really hope there is something less time-consuming :P What do you think?

amin
Level 1
Level 1
Posts: 23
Joined: Mon May 07, 2007 2:20 am

Re: "sudo" screwed

Post by amin » Sun Jul 01, 2007 8:20 am

reboot
put your MInt CD
choose Rescue

Then you can mount what ever partition you have to say: /rescue
Then edit the sudoer file.
Hope it help.

blackcoatman
Level 1
Level 1
Posts: 13
Joined: Fri Jun 29, 2007 4:25 pm

Post by blackcoatman » Sun Jul 01, 2007 9:56 am

Thanks man. I managed to edit the file from the livecd. When I rebooted, i had an X error because of a mismatch of the nvidia driver (100.xx) and the kernel module. Apart from that, "sudo" gave a "mode is 0644, should be 0440" error, which I fixed with the "chmod" command. I tried it again, and now i get ANOTHER error:

" /etc/sudoers is owned by uid 999, should be 0 "

I can't find anything on the net this time... I hope someone is familiar with this...?

blackcoatman
Level 1
Level 1
Posts: 13
Joined: Fri Jun 29, 2007 4:25 pm

Post by blackcoatman » Sun Jul 01, 2007 10:07 am

I think I know what's the problem, I just don't know how to fix it... In order to change the contents of the sudoers file, I had to do "visudo" in livecd mode, I then saved the file over the sudoers file in my root partition, since gedit couldn't overwrite the file when I tried to directly edit it, even as root with rw permission. Maybe I have to change my UID when running livecd to 0 somehow, then I can try again...
EDIT: I checked the User settings and teh only user is (of course) root, with a 0 user ID. So now I'm stuck again... Damn, I hope eventually someone else finds all these useful :P

***SOLVED***

I had to do "chown 0 sudoers" and "chgrp 0 sudoers".

scorp123
Level 8
Level 8
Posts: 2277
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 » Sun Jul 01, 2007 11:47 am

blackcoatman wrote: /etc/sudoers is owned by uid 999, should be 0
Repeat after me: uid 0 = root! uid 0 = root! uid 0 = root! uid 0 = root! uid 0 = root! uid 0 = root! .... :lol:

sudo chown root:root /etc/sudoers :lol:

blackcoatman
Level 1
Level 1
Posts: 13
Joined: Fri Jun 29, 2007 4:25 pm

Post by blackcoatman » Sun Jul 01, 2007 1:39 pm

*writes it down 100 times as punishment* :P :P

scorp123
Level 8
Level 8
Posts: 2277
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 » Sun Jul 01, 2007 1:50 pm

blackcoatman wrote:*writes it down 100 times as punishment* :P :P
Hey, wouldn't that make a great "intro" for "The Simpsons"? Bart Simpson standing there at the board and writing it down ... before the bell rings and he rushes off on his skateboard? :lol:

Post Reply

Return to “MATE”