Ubuntu – Sudo: unable to stat /etc/sudoers.d/README: No such file or directory

chmodpermissionssudo

Whenever i use sudo command i get this message:

sudo: unable to stat /etc/sudoers.d/README: No such file or directory

i ran into this trouble when i was strugling with chmod using which i changed the permissions on /etc/sudoers, /etc/sudoers.d and also /etc/sudoers.d/README

I solved the issue with /etc/sudoers from this link.

Nut now when I look at the permissions of the file /etc/sudoers.d/README, it says 'the permissions of README could not be determined'

This happens when i use ls

ls -l /etc/sudoers.d/
ls: cannot access /etc/sudoers.d/README: Permission denied
total 0
-????????? ? ? ? ?            ? README

Best Answer

This is what it should be:

ls -l /etc/sudoers.d/
total 4
-r--r----- 1 root root 958 feb 10 20:20 README

so to restore permissions do a:

sudo chown root:root /etc/sudoers.d/README
sudo chmod 440 /etc/sudoers.d/README

From comments: the level above seems wrong so do this 1st:

ls -ltr /etc | grep sudoers.d
drwxr-xr-x  2 root root       4096 mrt 20 08:32 sudoers.d

so to restore permissions do a:

sudo chown root:root /etc/sudoers.d
sudo chmod 755 /etc/sudoers.d