1. 程式人生 > >在某個使用者(xxx)下使用sudo的時候,提示以下錯誤:xxx is not in the sudoers file. This incident will be reported

在某個使用者(xxx)下使用sudo的時候,提示以下錯誤:xxx is not in the sudoers file. This incident will be reported

1、切換到root使用者

xxx$:    su root

2、進入etc目錄中

root#:  cd /etc

3、修改sudoers檔案許可權

root/etc#:  chmod u+w sudoers

4、新增使用者的許可權

root/etc#:  vim sudoers

root/etc#: xxx    ALL=(ALL)    ALL(找到root ALL=(ALL)    ALL下面新增

5、退出儲存,修改sudoers的檔案許可權

root/etc#:  wq!

root/etc#:  chmod u-w sudoers

6、切換使用者就可以了