Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I recently started having this error when using the sudo command:

sudo: /etc/sudoers is mode 0644, should be 0440
sudo: no valid sudoers sources found, quitting

Any idea how to resolve this? I use Ubuntu.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The error tells you that you need to set the file permissions of /etc/sudoers to 0440. Log in as root or escalate yourself to root using su and type chmod 440 /etc/sudoers.

Have no idea how file permissions could have changed though.

share|improve this answer
    
Need to be careful about what you change.. If you don't have the ability to log in directly as root, you'll need to boot into single-user mode to fix the permissions. –  Shane Madden Apr 8 '11 at 21:11
    
True, and actually, by default Ubuntu has no password set on root user, so you probably won't be able to run su or log in as root directly. To boot into single user mode you'll need to select the kernel configuration that you'll boot into when grub starts up at boot time. For a basic instructional as to how to login in single user mode, see the first bit of debuntu.org/recover-root-password-single-user-mode-and-grub –  photoionized Apr 8 '11 at 21:16
    
One of the first things todo on a fresh ubuntu is running sudo su and then passwd. Choose long secure password and keep a hardcopy of it along with your hardware documents - just to be safe. –  mbx Apr 8 '11 at 21:22
    
Can't do that because the ironic thing is I don't have sudo permissions in order to perform the chmod command :) –  Genadinik Apr 8 '11 at 21:23
2  
Which is why you need to be the root user, not an unprivileged user trying to run a privileged command through sudo. If you have a password already set for the root user see my answer regarding su above, or if you don't, see the link in my comment about becoming the root user through booting into single user mode. –  photoionized Apr 8 '11 at 21:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.