几天前我开始使用 Ubuntu Server,遇到了一个奇怪的错误:
ubuntu@ubuntu: $ sudo -s
sudo: /var/lib/sudo/ubuntu/ is accessible in write mode from not-owner (040777), should have modality 0700
意大利语信息翻译如下:
sudo: /var/lib/sudo/ubuntu è accessibile in scrittura dal non-proprietario (040777) dovrebbe avere la modalità 0700
结果如下:
ubuntu@ubuntu: $ pkexec chmod 0700 /var/lib/sudo/
==== AUTHENTICATING FOR org. freedesktop.policykit.exe ===
Authentication is needed to run '/bin/chmod' as the super user
Authenticating as: ubuntu,,, (ubuntu)
Password:
==== AUTHENTICATION COMPLETE ===
我也尝试使用“sudo”,但它不起作用......
我想发布图片,但抱歉我不能
答案1
尝试运行以下命令来修复损坏的 sudo -
sudo chmod 0755 /var/lib/sudo
sudo chmod 0700 /var/lib/sudo/<username>
如果上述命令没有帮助,您可以运行以下命令:
pkexec chmod 0755 /var/lib/sudo
pkexec chmod 0700 var/lib/sudo/<username>