Permission-execute the command as another user-sudo

Source: Internet
Author: User
The administrator can configure the sudo command to allow a common user to execute commands in a different user identity (usually a super user) in a controllable way.

Introduction

The sudo command is similar to the su command in many aspects, but it also has some important functions.

The administrator can configure the sudo command to allow a common user to execute commands in a different user identity (usually a super user) in a controllable way.

Under certain circumstances, the user may be restricted to executing only one or several specific commands, but has no permission to execute other commands.

Another important difference is that using the sudo command does not require a superuser password.

========================================================== ======

Example

[Root @ allyes ~] # Sudo su-

========================================================== ======

View the permissions granted by the sudo command

[Root @ allyes ~] # Sudo-l

Matching Defaults entries for root on this host:

Env_reset, env_keep = "colors display hostname histsize inputrc kdedir LS_COLORS MAIL PS1 PS2 qtdir username lang LC_ADDRESS

LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME

LC_ALL language linguas _ XKB_CHARSET XAUTHORITY"

 

User root may run the following commands on this host:

(ALL) ALL

(ALL) NOPASSWD: ALL

[Root @ allyes ~] #

========================================================== ======

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.