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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/IOIO_/article/details/84112773

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

猜你喜欢

转载自blog.csdn.net/IOIO_/article/details/84112773