Ubuntu – problems with sudo permissions – /var/lib/sudo owned by uid

command linelocalhostpermissionssudo

my system is a new 11.04 ubuntu and i recently started working with LAMP.
some how, when i tried to change permissions of the var/www/ for netbeans to work on the local server, and did something that causes this notice to show every time i do a sudo:

sudo: /var/lib/sudo owned by uid 33, should be uid 0

this is bad?
how can i fix it?
what exactly i did?


Best Answer

To fix that particular issue is easy:

sudo chown -R root /var/lib/sudo

As for why that happened... I believe that when you were messing with permissions for /var/www you somehow, by accident, changed permissions (and ownership) of all /var tree, including /var/lib/sudo. (I bet the user you were trying to set has id=33)

This may have many consequenses, the sudo warning message being just one symptom.


As for the consequences... it really depends on what (and where) you did. Many (but not all) files and folds in the /var tree are owned by root:root, and its basically impossible to know who each and every file and folder originally belonged to. Full reinstall would be the only feasible way to restore it.

If you changed only the /var/lib tree, it narrows down the "damage", but not much: there are still hundreds of files there.

You can try to find out which command you issued caused this trouble, accesing your bash history:

gedit ~/.bash_history &

Maybe this will give a clue about what happened and its consequences

Related Question