今天作死改了/usr/bin文件夹的下一些文件的权限,就出这个问题了·····
Ubuntu16.04执行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
导致的原因:用ll查看了一下sudoer.so和sudo的用户权限,发现owner都是非root用户,所以才导致当前用户没有权限执行sudo命令,修改权限后,即可解决此问题。
解决方法:chmod 644 /usr/lib/sudo/sudoers.so
chown -R root /usr/lib/sudo
但是此时不能用下面出处的第二句命令,否则会出现下面的错误:
chown: changing ownership of '/usr/lib/sudo/sudoers.so': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/sesh': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/group_file.la': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/group_file.so': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/sudo_noexec.so': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/sudo_noexec.la': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/libsudo_util.so.0.0.0': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/libsudo_util.so.0': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/system_group.la': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/libsudo_util.so': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/libsudo_util.la': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/system_group.so': Operation not permitted
chown: changing ownership of '/usr/lib/sudo/sudoers.la': Operation not permitted
chown: changing ownership of '/usr/lib/sudo': Operation not permitted
正确的姿势chmod 644 /usr/lib/sudo/sudoers.so
su
输入密码进入suchown -R root /usr/lib/sudo
来源:CSDN
作者:HollrayChan
链接:https://blog.csdn.net/HollrayChan/article/details/104006453