Linux初级——xxx is not in the sudoers file
这是一篇修改错误的,从文件夹里找到,感觉挺有意义,为防止丢失,决定写下来。
当Linux系统中出现以下错误,可以试着修改,本人修改成功了。
xxx is not in the sudoers file
$sudo root;切换到root
#ls -l /etc/sudoers;查看权限
-r--r--
#chmod 777 /etc/sudoers;修改为可执行
#ls -l /etc/sudoers
-rwxrwxrwz
#gedit /etc/sudoers
root ALL = (ALL) ALL
user ALL = (ALL) ALL;允许用户user执行sudo命令
%user ALL =(ALL) ALL;允许用户组user执行sudo命令
user ALL = (ALL) NOPASSWD:ALL;允许用户user执行sudo命令,不需要密码
#chmod u-w /etc/sudoers;撤销sudoers文件写权限

