How to add a user to a sudo user group through CentOS

Source: Internet
Author: User
After Fedora14 is installed, sudo is not enabled by default. you should first set sudo. The role of sudo is to allow the current non-root user to directly add sudo to the command before using commands without permissions, and then enter the password of the current user to complete the function of the root user, you don't have to switch users back and forth every time you use su. The sudo configuration file is located in/etc/sudoers and requires the root permission to read and write data. Find the line rootALL = (ALL) ALL. after Fedora14 is installed, sudo is not enabled by default. you should first set sudo.
The role of sudo is to allow the current non-root user to directly add sudo to the command before using commands without permissions, and then enter the password of the current user to complete the function of the root user, you don't have to switch users back and forth every time you use su. The sudo configuration file is located in/etc/sudoers and requires the root permission to read and write data.
Find the line root ALL = (ALL) ALL, and add a line to the end (no quotation marks required ):
"Username ALL = (ALL) ALL"
Here, username is the specified sudo user, and the space in the quotation marks is tab
If you want to prompt you to enter the root password every time you use the sudo command, move to this line:
# % Wheel ALL = (ALL) ALL
Uncomment #
If you do not want to prompt you to enter the password and move it to the following line every time you use the sudo command:
# % Wheel ALL = (ALL) NOPASSWD: ALL
Uncomment #
Save and exit
Add the user name to the wheel User group:
Usermod-G wheel username
Related Article

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.