New users of centos and Ubuntu cannot use sudo

        In addition to the users created when installing the desktop version of the Linux system, other newly created users cannot use

sudo command, at this time you need to add the user to the sodo group.

Take user ceshi as an example

Use the command visudo or run

vim /etc/sudoers

Edit the sudoers file directly

root ALL=(ALL:ALL) ALL

linc ALL=(ALL:ALL) ALL

hundreds:

Add the user to the wheel group

usermod -aG wheel ceshi -G to modify the current secondary group -aG to add a new secondary group

usermod -g wheel ceshi -g modify the user's primary group

Remove the test user from the wheel group

gpasswd wheel -d test

Ubuntu

Add the user to the sudo group

usermod -aG sudo ceshi

Guess you like

Origin blog.csdn.net/qq_35002542/article/details/128313073