Use of the sudo command

Source: Internet
Author: User

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

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.