In the Linux system, some ordinary users need to use the root account to perform some operations, but we do not have root password to ordinary users, there is sudo
Sudo can temporarily switch to the specified account for operation
How to use:
sudo [-u user account] need to execute the command, when switching to root, you can directly execute sudo execution command;
Conditions of Use:
Visudo must be executed as root to add users who need to execute the sudo command;
Execute Visudo, actually modify the/etc/sudoers file;
To modify the configuration:
[email protected] ~]# Visudo
Root all= (All) all <== find this line
Liu All= (all) all <== new row, save exit
User account: Indicates which account in the system can use the sudo command
The first all: the host name of the source of the login, indicating which host the account can connect to, all means any host.
The second all: a switchable identity that indicates which account the account can switch to, all means that it can be switched to any user
The third all: an executable command that indicates which commands can be executed by this account, all indicating that any command can be executed
To test:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/79/ED/wKiom1aeCiTwN5OtAABau2uht8k525.png "title=" q75% G9n7{w2gd0~9 (j06@) w.png "alt=" Wkiom1aecitwn5otaabau2uht8k525.png "/>
Results:
You can see that the owner of the directory created by the user Liu is: root
This article is from the Linux OPS Phase learning blog, so be sure to keep this source http://liuzhengwei521.blog.51cto.com/4855442/1736581
Use of the sudo command