在学习Linux中,遇到如下问题,其他用户切换系统管理员权限提示xxx is not in the sudoers file. This incident will be reported.
#useradd yc
#password yc
在yc下切换root,sudo -i
出现如下提示
则需要,在root用户里,找到/etc/sudoers文件,给该用户添加权限
1.#chmod u+w /etc/sudoers //一般sudoers文件只读,需赋予写权限
2.在root ALL=(ALL) ALL下面添加一行,用户名 ALL=(ALL) ALL ,保存文件退出
3.#chmod u-w /etc/sudoers //收回写权限