Take care of your sudoers.d permissions!

Sudoers does not work on Hackswell, and I wasn’t aware why. For some reason, files in my /etc/sudoers.d do not work on one machine, yet they work on another one. Both permissions seems to be identical.

sudo chmod 0755 /etc/sudoers.d

sudo ls -lah /etc/sudoers.d

total 20K
drwxr-xr-x  2 root root 4.0K Dec 19 09:28 .
drwxr-xr-x 93 root root 4.0K Dec 20 15:11 ..
-r--r-----  1 root root   42 Dec 18 14:14 walter
-r--r-----  1 root root   54 Dec  9 12:07 psd
-r--r-----  1 root root   93 Sep 16 10:27 wheel

sudo visudo -c
/etc/sudoers: parsed OK
/etc/sudoers.d/walter: parsed OK
/etc/sudoers.d/psd: parsed OK
/etc/sudoers.d/wheel: parsed OK

15:24 walter@hackswell:~ $ sudo ls -lah /etc/sudoers
-r--r----- 1 root root 5.0K Dec  9 12:11 /etc/sudoers

MacBook Pro 13

For some reason, it works on my MacBook Pro. I have no idea why, so I’d keep it for the record, to return to one day in the future. I really don’t get it, why doesn’t it work.

sudo ls -lah /etc/sudoers.d

total 20K
drwxr-x---   2 root root 4.0K Dec 17 16:40 .
drwxr-xr-x 103 root root 4.0K Dec 20 14:30 ..
-r--r-----   1 root root  179 Dec 17 16:40 walter
-r--r-----   1 root root   43 Nov 10 20:47 ddcutil
-r--r-----   1 root root   55 Nov 17 12:58 psd-overlay-helper

Solution

Almost two years later, I noticed that the directory permissions aren’t identical, and I need

sudo chmod g-x /etc/sudoers.d

to fix it.

••• Linux Arch Linux

Reply by Email