Linux Learning notes < 24 >--sudo

Source: Internet
Author: User

sudo: What commands a user can perform with another user's identity through which hosts

sudo COMMAND

-L: Lists all sudo class commands that the current user can use

-K: Disable authentication information, i.e. authentication required for each execution


sudo configuration file/etc/sudoers

A line defines a sudo entry:

Whowhitch_hosts= (runas)tag:command


Supported alias, can be used! Take the reverse

Who:user_alias

Which_hosts:host_alias

Runas:runas_alias

Command:cmnd_alias

Aliases must all and only use a combination of uppercase English letters



User_alias

User's user name

% Group Name

# UID

You can also include other user aliases that are already defined


Host_alias

Host Name

Ip

Network address

Other host aliases


Runas_alias:

User name

% Group Name

Other runas aliases


Cmnd_alias:

Command path

Directory (all commands in this directory)

Other pre-defined command aliases

Example User_alias Useradmin=hadoop,%hadoop,%useradmin

Cmnd_alias useradmincmd=/usr/sbin/useradd,/usr/sbin/usermod,/usr/sbin/userdel,/usr/bin/passwd [A -za-z]*,! /USER/BIN/PASSWD Root


TAG

NOPASSWD: Execute command is not required to enter password authentication

PASSWD


Useradmin all= (Root) nopasswd:useradmincmd


After execution, do not enter the password again within 5 minutes

Execution information will be saved to/var/log/secure


Linux Learning notes < 24 >--sudo

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.