Set sudo permissions for common centos users
Create a common test user test under the root user, switch to the test user, and run mkdir or rm-rf
Permission denied may occur because the user has no root Permission.
[test@iZ2513wqj05Z app]$ mkdir testmkdir: cannot create directory test? Permission denied[test@iZ2513wqj05Z app]$
Solution:
1: switch to the root user
[test@iZ2513wqj05Z app]$ su rootPassword: [root@iZ2513wqj05Z app]#
2: grant root permissions to common users
Edit the/etc/sudoers configuration file, find the following line, and add a line under root, as shown below: root ALL = (ALL) ALL test ALL = (ALL) ALL modified, now you can log on with the test account and run the su-command to obtain the root permission.
3: exit the root user
[root@iZ2513wqj05Z app]# exitexit[test@iZ2513wqj05Z app]$
4: run the linux Command: sudo mkdir test
[test@iZ2513wqj05Z app]$ sudo mkdir test[sudo] password for test: [test@iZ2513wqj05Z app]$ lltotal 267596drwxr-xr-x 2 root root 4096 Feb 17 17:14 test