Ubuntu Error “sudo: /etc/sudoers is mode 0640, should be 0440″

by Craig Mayhew on Sep.27, 2009, under Guides/Fixes, Linux/Ubuntu

If for whatever reason you change the permissions on your sudoers file you will get a similar error to “sudo: /etc/sudoers is mode 0640, should be 0440″ whenever you try to run the sudo command. The problem is that because the permissions are wrong on the sudoers file, linux won’t let you run the sudo command!

To get around this press “Esc” at the grub loader screen when linux is booting and enter into the latest recovery mode. Then select the option that allows you to drop into a command line as root and type

chmod 0440 /etc/sudoers

Then reboot and your troubles should be solved!

:, ,

7 Comments for this entry

  • koguma

    Thanks a LOT !!!
    I was near to reinstall my ubuntu server and with your help I could avoid it….

  • eby louis

    thanks a lot
    can u describe about the sudoers entries
    how can i reduce the 15 minute allowed time for a user in sudoers entry

    have a nice day

  • A Leach

    I had this problem after messing around with samba. I wasn’t in a position where I could restart my (Ubuntu 10.10) server, so I ignored it.. Now I just found a solution though: drop to the su shell.

    Problem:-
    $ sudo vim /etc/bash.bashrc
    sudo: /etc/sudoers is mode 0640, should be 0440
    sudo: no valid sudoers sources found, quitting

    Solution:-

    $ su -
    Password:
    root@metabuntu:~# chmod 0440 /etc/sudoers
    root@metabuntu:~# logout
    $ sudo vim /etc/bash.bashrc ## Now works!!!

  • kumar

    After I issued command chmod -R 777 /etc
    all the services are down like networking services, mysql services. when i type sudo command it shows
    sudo: /etc/sudoers is mode 0640, should be 0440
    sudo: no valid sudoers sources found, quitting
    when i type su root
    password:
    authentication failure.

    can anyone plz tell me the solution for the above prob

  • Derrick

    For those of you that “ESC” key doesn’t work, try holding down the left shift key.

1 Trackback or Pingback for this entry

Leave a Reply


In a bid to lower the spam levels on this blog, please type the following captcha code

Visit our friends!

A few highly recommended friends...