Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Whenever I run a sudo command in the terminal, this happens:

arun@arun-GP70-2OD:~$ sudo apt-get update
sudo: /etc/sudoers.d/README is world writable
sudo: /var/lib/sudo writable by non-owner (040777), should be mode 0700
 [sudo] password for arun:

The sudo commands still work (I think so, although the only one I have tested is sudo apt-get).

What are these strange messages before I get asked for the password? Is there any big problem here? Should I do something about this? Or can I just leave it like this and continue using my system?

share|improve this question
    
Well, did you check the permission on /etc/sudoers.d/README file as the error suggested ? – Serg Mar 28 at 9:30
3  
I'd be concerned about overall system security/stability at this point, as clearly something has happened to screw up permissions. It may be the relatively safe option of a filesystem becoming corrupt, or something more insidious. – Phil Lello Mar 28 at 19:32
    
@Phil Lello Yes, I formated my drive and did a clean install. More details in the comments under the accepted answer. – Fiksdal Mar 28 at 19:43
up vote 19 down vote accepted

The messages are self explanatory.

By design sudo related files and libraries should only be readable (and writable if needed) by root.

The directory /var/lib/sudo contains individual user's sudo related data, which could be easily read/modified if a non-root user have sufficient permission, which is of course a security issue.

The file /etc/sudoers.d/README contains info regarding implementation of sudo. Imagine a rogue user edit the file and add false info (and you follow that).

So, in a nutshell, fix the permissions:

sudo chmod 0400 /etc/sudoers.d/README
sudo chmod -R 0700 /var/lib/sudo  ## Recursively

And of course make sure the owner is root (and group root).

share|improve this answer
    
Comments are not for extended discussion; this conversation has been moved to chat. – Oli Mar 28 at 10:48
    
@heemayl Maybe it's worth adding to the answer that whatever caused a problem like this might possibly have caused other security problems as well? I, fearing this, formated my drive and did a clean install. – Fiksdal Mar 29 at 4:52

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.