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