Problem: xxx is not in the sudoers file. This incident will be reported

Problem

There is a problem when user dijk execute command below:

$ sudo usermod -aG vboxsf dijk

or

$ sudo gpasswd -a dijk vboxsf

Problem: “dijk is not in the sudoers file. This incident will be reported.”


Solution

$ su root

// add write priviledge
# chmod u+w /etc/sudoers

// add dijk line after root line, below
# vi /etc/sudoers
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
dijk    ALL=(ALL)       ALL


# su dijk
$ sudo usermod -aG vboxsf dijk
[sudo] password for dijk:

// input dijk's password, above

$ su root
// del write priviledge
# chmod u-w /etc/sudoers

Other commands may need

// see user dijk info
$ id dijk

// see group info
$ vi /etc/group

// remove dijk from vboxsf group
$ sudo gpasswd -d dijk vboxsf

// see group info, confirm user dijk really removed from vboxsf
$ vi /etc/group
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章