2

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
Rohit Chopra
  • 29
  • 1
  • 1
  • 3

1 Answers1

9

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
Rinzwind
  • 299,756
  • My CentOS65 box shows /etc/sudoers.d as 750, but my 14.04 box reflects your answer, 755. The difference is to support/protect Debians addition of the #includedir /etc/sudoers.d to its baseline /etc/sudoers file. shrug – 0xSheepdog Jun 13 '14 at 19:47
  • Funny :D I have no centos here (at work I do). Never knew those are different. – Rinzwind Jun 13 '14 at 19:55
  • @0xSheepdog The 750 permissions on CentOs /etc/sudoers.d means that users who are not the owner of, nor in the same group as, /etc/sudoers.d cannot see (lookup, stat, read) within /etc/sudoers.d – waltinator Jun 13 '14 at 20:24