Add normal users to the sudo group under CentOS and password-free login

Source: Internet
Author: User

1.1 sudo sudo is a Linux system in which non-root users elevate their privileges to perform certain feature commands, which allows ordinary users to temporarily gain root privileges without knowing the Superuser's password.
In general, ordinary users in the execution of special commands, only need to add sudo in front of a special command (such as Yum), and enter their own user password, in the next 5 minutes, the use of special commands again, there is no need to enter the user password again.
At the same time, Sudo provides powerful log management, detailing what each user has done.

sudo user management is stored in the file:/etc/sudoers. In other words, if you want to add a user to the Sudo user base, you need to configure the file yourself, and you need root permission to read and write this file.

1.2 Adding a user to the sudo group when using sudo, if "DBA is isn't in the sudoers file" appears. This incident would be reported. " Description Current user name: DBA does not have permission to use sudo, this time we need to modify/etc/sudoers to add sudo permissions to the current user DBA.

[[email protected] ~]$ sudo yum-y Updatewe Trust you had received the usual lecture from the local systemadministrator. It usually boils down to these three things:    #1) Respect the privacy of others.    #2) Think before you type.    #3) with great power comes great responsibility. [sudo] password for DBA:DBA isn't in the sudoers file.  

    1. Use the "su–" command to enter the root user;
    2. Add Write permission to the sudoers file: Use the command "chmod u+w/etc/sudoers"
    3. After executing the visudo command, press "I" to enter edit mode, find "root all= (All) All", add: "DBA all= (All) Nopasswd:all", then click "ESC" key to exit edit, after "Wq" (write quit) , Exit Sudoers. Ss
    4. Enter "chmod u-w/etc/sudoers" To remove the Write property of the file
    5. When you switch back to your users with "exit" and then use the sudo whoami command, if you return root, you can use the

Add normal users to the sudo group under CentOS and password-free login

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.