jags
jags

Reputation: 557

How to get rid off - sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins

I am trying to configure apache2 with cgi (python). For that, I have to change permissions of some folders and files but I am getting sudo fatal errors every time I try to change permission of a file or a Folder.

For Example:

1

j@ubuntu:/etc/apache2$ ls

apache2.conf envvars magic mods-enabled sites-available

conf.d httpd.conf mods-available ports.conf sites-enabled



j@ubuntu:/etc/apache2$ sudo chmod 777 httpd.conf

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

sudo: fatal error, unable to load plugins

...................................................................................

2

j@ubuntu:/usr/lib/cgi-bin$ sudo /etc/init.d/apache2 restart

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

sudo: fatal error, unable to load plugins

...................................................................................

3

j@ubuntu:/usr/lib$ sudo chmod -R 777 /usr/lib/cgi-bin

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

sudo: fatal error, unable to load plugins

...................................................................................

Note:

j@ubuntu:/etc/apache2$ ls -l /usr/lib/sudo/sudoers.so

-rwxrwxrwx 1 root root 177452 Jan 31 2012 /usr/lib/sudo/sudoers.so

Any help would be highly appreciated !

Upvotes: 3

Views: 20801

Answers (5)

pietvr
pietvr

Reputation: 1

Try this:

pkexec chmod go-w /usr/lib/sudo/sudoers.so

Upvotes: -1

rapttor
rapttor

Reputation: 509

for OSX, there is diskutil command to repair disk permissions:

diskutil resetUserPermissions / `id -u`

it will take a while :( ... you might first try to open script editor, create new script and execute:

do shell script "chown -R root /usr/local/libexec/sudo/sudoers.so" with administrator privileges

if that does not work, the repairpermission should do the trick.

Upvotes: 0

Sébastien Dan
Sébastien Dan

Reputation: 1384

If you have docker installed on your host, you can leverage its permission vulnerabilities on volumes to solve this issue.

Run docker run -it -v /usr/lib/sudo:/tmp ubuntu:xenial

Once inside the container, being the root user there, you can:

  • cd /tmp
  • chown root sudoers.so or chmod 644 sudoers.so depending on the exact issue

It's not a really clean solution but it solves the issue.

Upvotes: 4

Tamil
Tamil

Reputation: 1

Please try to login as a root user and change the file permission for the directory as

chmod 700 /usr/lib/sudo/sudoers.so then it will solve your problem.

It worked for me!

Upvotes: -1

Pranab Sharma
Pranab Sharma

Reputation: 739

You have to login to root shell to resolve this sudoers.so permission issue. If you have root account login, directly login to root shell otherwise search something like "How do I boot into a root shell" or "Drop to root shell prompt". If you use Ubuntu you can follow this link https://askubuntu.com/questions/92556/how-do-i-boot-into-a-root-shell. Once you are in root shell change the permission of the file /usr/lib/sudo/sudoers.so to

#chmod 644 /usr/lib/sudo/sudoers.so

Upvotes: 2

Related Questions