sudoers trouble

Asked by FERNANDO TÚLIO CAMILO BARRETO

I have a ubuntu 10.10 installed on dual boot with vista (AMD turion X2 64). Trying to understand more about superuser, sudo , and other things, a wrote on the terminal sudo chmod 666 etc/sudoers.d in order to have the permission to read the makefile. Now when I try to enter as superuser (typing sudo bash) or any command with sudo I get this message: sudo: can't open /etc/sudoers.d/README: Permission denied
>>> /etc/sudoers: /etc/sudoers.d/README near line 23 <<<
sudo: parse error in /etc/sudoers near line 23
sudo: no valid sudoers sources found, quitting.

Someone could help to go back in normality.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sudo Edit question
Assignee:
No assignee Edit question
Solved by:
FERNANDO TÚLIO CAMILO BARRETO
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Have you been editting the file? If you mess up the file you will get this sort of error. I suggest you boot to root recovery mode and run:

nano /etc/sudoers

And make it look like this:

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

Then press CTRL+X, Press Y, Press ENTER then run:

reboot

I suggest you do NOT mess with that file at all.

Revision history for this message
FERNANDO TÚLIO CAMILO BARRETO (hpftcb) said :
#2

I made no modifications....Do I have to writethe above (the # lines) after I enter nano /etc/sudoers ( and it-s sudoers.d)?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

I'm just quoting
https://help.ubuntu.com/community/Sudoers

I'd make it identical, I am not sure what is really needed. The ONLY way that file will ever be changed is by users fiddling so one of the users of your system (or someone with access) has been changing it.

Revision history for this message
FERNANDO TÚLIO CAMILO BARRETO (hpftcb) said :
#4

OK, thank you a lot, anyway

Revision history for this message
FERNANDO TÚLIO CAMILO BARRETO (hpftcb) said :
#5

I discoved how to solve.. I went to recovery, then sudo recovery. So I typed chmod 777 /etc/sudoers.d .

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

Mine is:

drwxr-xr-x 2 root root 4096 2011-01-20 19:46 sudoers.d

Which is 755. 777 is a REALLY bad idea prett much ANYWHERE in Linux as it is very unsecure.

Revision history for this message
FERNANDO TÚLIO CAMILO BARRETO (hpftcb) said :
#7

Good advice. I changed the permissions to 755. Thank you !

Revision history for this message
Sam_ (and-sam) said :
#8

Origin sudoers.
Access: (0440/-r--r-----) Uid: ( 0/ root) Gid: ( 0/ root)

> Trying to understand more about superuser
http://www.gratisoft.us/sudo/sudoers.man.html

Revision history for this message
FERNANDO TÚLIO CAMILO BARRETO (hpftcb) said :
#9

Thanks Samantha

Revision history for this message
FERNANDO TÚLIO CAMILO BARRETO (hpftcb) said :
#10

Samantha, in fact how do I manage suid and sgid. where are this pastes? will the command be chmod 000 ?

Revision history for this message
Sam_ (and-sam) said :
#11