Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Getting back root permissions not working

Writer Sebastian Wright

I'm getting stick with Sudo permissions.

Actually when I try to run any command using sudo

sudo: error in /etc/sudo.conf, line 0 while loading plugin 'sudoers_policy'
sudo: /usr/lib/sudo/sudoers.so must only be writable by owner
sudo: fatal error, unable to load plugins

here's the return of sudoers file permissions

-rw-r--r-- 1 farouk root 354592 sept. 23 16:59 /usr/lib/sudo/sudoers.so

2 Answers

When reading the error messages, the second line stood out for me:

sudo: /usr/lib/sudo/sudoers.so must only be writable by owner

I suspect your problem is from having both read and write permissions as the owner. To fix, attempt:

chmod u-r /usr/lib/sudo/sudoers.so

I hope this helps.

The error message you quoted comes from the sudo_check_plugin function in load_plugins.c. It prints that message as a result of this test:

if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) 

This tests the permissions of the /usr/lib/sudo/sudoers.so file (previously opened with stat), held in the sb variable, to see whether the group-writable or other-writable bits are set. In other words, it's checking to see if that file is writable by anyone other than the owner. It previously checked that the owner of the file was root:

if (sb.st_uid != ROOT_UID)

... which would have reported:

sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0

in your case, since you've demonstrated a file ownership of farouk:root.

Either you've shown us the wrong file or something else changed in the meantime. See what your /etc/sudo.conf file says for "Plugin sudoers_policy". If it has the full path to something other than /usr/lib/sudo/sudoers.so, then you need to fix the permissions of that other file.

Regardless, it's incorrect to have a non-root user own the file you've shown; restore its ownership by logging in directly as root or by mounting the disk from recovery media.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy