The sudo command under Linux system is mainly used to allocate system permissions. Using the sudo command can improve the permissions of ordinary users and perform some operations. Here's how to use the sudo command in Linux?
First, the characteristics of sudo:
1, the user specifies authorized management command specified operation on the specified host;
2, based on a detailed record of the user sudo Log information related to the executed command;
3, "Check-in system": Time-sensitive authentication, the user will be required to enter the password to verify the user's identity when the user first executes sudo. After successful, the user will get a There is a fixed lifetime of "tokens"; 5 minutes
Second, how to achieve sudo function?
/etc/sudoers: Authorization files can only be edited by the administrator; but generally do not use vim to edit directly, because syntax errors may occur, so the special editing tool visudo command is generally used to authorize.
/etc/sudoers:
Note: Alias definition: Aliases must use all uppercase characters
Built-in variables: ALL: All users
User_Alias:< Br>
User_Alias NAME = item1, item2, . ..
item:
Username
%groupname
#UID
$#GID
User_Alias (indicating that an already defined alias can be used)
Example: User_Alias ADMIN =CentOS, %lx,#500
means to define the ADMIN alias, with centos user, lx group, UID 500 User
Host_Alias: On which hosts you can run
Host_AliasNAME = item1, item2, . . .
item:
hostname
ip
network
Host_Alias
Example: Host_Alias ALLOWADDR =172.16. 37.10,172.16.0.0/16
means to define the ALLOWADDR alias, with ip of 172.16.17.10, network address of 172.16.0.0/16
Runas_AliasNAME
Runas_AliasNAME = item1, Item2, . . .
Usage is the same as User_Alias
Cmnd_Alias:
Cmnd_AliasNAME = item1, item2, . . .
item:
Commands
Directory (all commands in the directory)
Cmnd_Alias
Example: Cmnd_Alias COMMAND =/usr /sbin/useradd, /usr/sbin/userdel, /usr/sbin
means to define COMMAND aliases, all commands under useradd, userdel, and /usr/sbin
Reverse: Cmnd_AliasPASSWD = /usr/bin/passwd [0-9A-Za-z]*,! /usr/bin/passwd root Previous12Next page Total 2 pages
I accidentally deleted Ubuntus Grub boot under UEFI, so I cant boot into Ubuntu aut
In Windows, there is a multi-window mode that divides the screen into two equal parts, 4, but you wa
In the Linux system, the etc/profile file cant be changed. To change the etc/profile file, you need
In the Linux system, to set the boot, it is necessary to implement it through code.
Linux system Java is not compatible with Siyuan blackbody solution
Linux tips for viewing directory content
Linux terminal view public IP skills
Method for monitoring Linux command completion using PV commands
How to regularly clean up Nginx logs in Linux system
64-bit CentOS 6.4 installation configuration ntopng steps
Detailed method of configuring CentOS devices using Quagga software
What should I do if the NIC cannot be started after the Linux virtual machine is cloned?
Ubuntu uses Steam Music method
Ways to debug network performance using tools under Linux
How to use AWK regular expressions under Linux system
What should I do if the syntax of the Linux Vi editing code is not colored?
Win10 will be fully launched this summer for a year free upgrade. After this lifetime free of charge
Getting Started with Win10: The New Start Menu User Guide
How to create an administrator account for win7 computer?
win7 appears corrupted file Awc.exe solution
How to send texts in WeChat friends circle?
Modify the registry Windows 7 screensaver new tricks
Basic instructions for use under Linux and configuration of makefile
Win8 boot speed slow how to do