I recently started messing with some files on a virtual hosted machine and I was logged in a normal/non-root user. At first everything was fine, I was able to install anything I needed using:
sudo apt-get install tree
But I somehow messed up a file where now when I do that I get the following error:
sudo: can't open /etc/sudoers: Permission denied
I'm not sure how to diagnose this, I've googled for solutions but everything's about what sudo is and nothing related to what to do about re-enabling users to use it.
Let me know if you'd like any other details in comments :)
Edit:
ls -l /etc/sudoers
-r--r----- 1 root root 577 Apr 20 03:42 /etc/sudoers
ls -l /etc/sudoers– Caleb Apr 20 '11 at 9:29ls -l /usr/bin/sudo(or whereverwhich sudotells you the sudo executable is at) – Caleb Apr 20 '11 at 9:39/etc/group? Did you installsudousing your own./configurearguments? Is group 0rootorwheel? If it's wheel, you'll need to runchgrp wheel /etc/sudoersas root. – Mikel Apr 20 '11 at 9:48