Solution:
Switch to the root user first, and then modify the file:
[daixiang@localhost ~]$ su root Password: [root@localhost daixiang]# vim /etc/sudoers
(Recommended tutorial:centos tutorial)
We need to modify the sudoers file and add the user name to the file:
In command line mode, move the cursor to the beginning of the root ALL=(ALL) ALL line and press yy to copy the line. , press p on the next line to paste, and change root to the user name that needs to be given sudo permissions.
Note that you need to force save and exit (:wq!) when exiting.
Recommended related video tutorials:linux video tutorial
The above is the detailed content of Ordinary users under centos execute the sudo command and prompt that the permissions are insufficient.. For more information, please follow other related articles on the PHP Chinese website!