Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

How can I fix the following error with sudo?

/etc$ sudo
sudo: /etc/sudoers.d is world writable
usage: sudo [-D level] -h | -K | -k | -V
usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user
            name|#uid]
usage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user
            name] [-u user name|#uid] [-g groupname|#gid] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-D level] [-g
            groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]
            [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g
            groupname|#gid] [-p prompt] [-u user name|#uid] file ...
share|improve this question
    
looks like changing permissions on /etc is a bad thing serverfault.com/questions/364677/why-is-chmod-r-777-destructive serverfault.com/questions/221447/… – Grundizer Dec 29 '14 at 0:00

Run pkexec chmod 0755 /etc/sudoers.d

pkexec will use a different method of using root permissions, bypassing the issue.
And the chmod will fix the permissions.

share|improve this answer
1  
did not help :( – Unamata Sanatarai Oct 15 '14 at 14:34

Did you try going into recovery mode and switching the permissions back to 775 for sudoers? I tried it and it worked.

1) Get into Ubuntu Recovery

2) Do mount -rw -o remount /

3) Then chmod 775 -R /etc/sudoers and chmod 775 -R /etc/sudoers.d/.

This time it should work.

4) Then do a sudo apt-get install of any package to test before you leave recovery mode. Late reply but I encountered the issue recently and tried this. It worked fine atleast for the world writable issue.

share|improve this answer

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.