Set sudo permissions for common centos users

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.