Linux给用户添加sudo权限
当用户没有加入sudoers组时,在linux下面运行sudo命令,会提示类似:
xxxis not in the sudoers file. This incident will be reported.
然后导致无法执行sudo命令
这时候,如下解决:
当用户没有加入sudoers组时,在linux下面运行sudo命令,会提示类似:
xxxis not in the sudoers file. This incident will be reported.
然后导致无法执行sudo命令
这时候,如下解决:
chmod u+w /etc/sudoers
vim /etc/sudoers
,进入编辑模式,找到这一 行:root ALL=(ALL) ALL
在起下面添加xxx ALL=(ALL) ALL
(这里的xxx是你的用户名),然后保存退出。chmod u-w /etc/sudoers