Add user permissions to sudo (using the mongodo command)

Source: Internet
Author: User
Use mongodo to edit the etcsudoers file and grant the specific user the permission to execute sensitive commands. export = & quot; COLORSDISPLAYHOSTNAMEHISTSIZEINPUT uses mongodo to edit the/etc/sudoers file and grant the specific user the permission to execute sensitive commands.
Defaults requiretty
Defaults required env_keep = "colors display hostname histsize 1_kdedir LS_COLORS" Defaults env_keep + = "MAIL PS1 PS2 qtdir username lang LC_ADDRESS limit" ULTS limit + = "LC_COLLATE 1_1_lc_messages" Defaults env_keep + = "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE" Defaults env_keep + = "LC_TIME LC_ALL language linguas _ XKB_CHARSET XAUTHORITY"
Defaults secure_path =/sbin:/bin:/usr/sbin:/usr/bin
# Next comes the main part: which users can run what software on # which machines (the sudoers file can be shared between multiple # systems ). # Syntax: #### user MACHINE = COMMANDS #### The COMMANDS section may have other options added to it. #### Allow root to run any commands anywhereroot ALL = (ALL) ALL
# Allows members of the 'sys' group to run networking, software, # service management apps and more. # % sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
# Allows people in group wheel to run all commands % wheel ALL = (ALL) ALL
# Same thing without a password % wheel ALL = (ALL) NOPASSWD: ALL
# Allows members of the users group to mount and unmount the # cdrom as root # % users ALL =/sbin/mount/mnt/cdrom,/sbin/umount/mnt/cdrom
# Allows members of the users group to shutdown this system # % users localhost =/sbin/shutdown-h now
# Read drop-in files from/etc/sudoers. d (the # here does not mean a comment) # includedir/etc/sudoers. d

Wheel is a group in Linux. you can see in the/etc/group file that you want to add users who need sudo permissions to the group to execute the sudo command, and most of the commands are executed. NOPASSWD indicates that you do not need a password when executing the command. in normal cases, the password should be required. it is too troublesome.






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.