Add sudo permissions for the average user Linux environment

Add sudo permissions for the average user Linux environment
background
sudo command is a Linux system management, allowing the system administrator to allow ordinary users to perform some or all of the root command of a tool. Linux system, for safety, our operations are generally operating under a normal user, but sometimes you need to use common root privileges, such as when installing the software. This time efficiency if we cut back under the root user will be relatively low, so use sudo command comes in handy.

Installation sudo
have to install sudo, installed before setting method

yum install sudo // this package is very small, less than 1M

Provided
(1) into the root, opens sudoers file
su root // root user enters 
vim / etc / sudoers // Open the configuration file sudo

Modify sudoers file 
to find a line as shown (root ALL = (ALL) ALL )

Then add test sudo permissions to the general user, the "root ALL = (ALL) ALL " under this line, was added as shown in row (username ALL = (ALL) ALL), and stored. 
Then write permissions to recover some small partner may notice sudoers file is simply a read-only file, in fact, forced to modify, then it does not matter, but if you do not feel safe, you can give the file write permissions (W) before modifying the file, then save changes , as follows
chmod u + w / etc / sudoers 
after // Altered complete: 
the chmod UW / etc / the sudoers

Test
now to test user sudo privileges, and we try to look at sudo command to create a gcc installed in the test user can install the phenomenon as follows :()

Guess you like

Origin www.cnblogs.com/ritchy/p/12094486.html