12_rhel7.1 add sudo permissions to ordinary users

Source: Internet
Author: User

1. About sudo

sudo is a Linux system in which non-root users elevate their privileges to execute certain feature commands, which allows a normal user 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.

2. Ways to add users to sudo

When using sudo, if "xxx is not in Thesudoers file" appears. This incident would be reported "description current username: XXX is not authorized to use sudo, this time we need to modify the/etc/sudoers to add sudo permission for the current user xxx.

1 Use the "su–" command to enter the Superuser

2. Open Sudoers

[Email protected] ~]# vim/etc/sudoers

3. Locate the root all= (all) all line, followed by a row

Username all= (All) all

Where username is the specified user using sudo

4. Finally type the command "wq!" in vim Save and exit. (This file is read-only and does not add "!") Save will fail)

12_rhel7.1 add sudo permissions to ordinary users

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.