Linux User management rights Visudo

Source: Internet
Author: User

User administrative rights Visudo
Example: Create user Kang, Grant yum privileges, useradd permissions [[email protected] ~]# useradd kang[[email protected] ~]# passwd kangchanging Password for user Kang. New Password:retype New Password:passwd:all authentication tokens updated successfully. [[email protected] ~]# tail-1/etc/passwdkang:x:501:502::/home/kang:/bin/bash[[email protected] ~]# Visudo #开通yum与useradd权限, if you need to open all permissions, please use all## allow ROOT to run any commands anywhereroot all = (All) Allzabbix all= (All) Allkang all= (All)/usr/sbin/useradd,/usr/bin/yum[[email protected] ~] $ sudo reboot #reboot no permissions [sudo] password for kang:sorry, user Kang was not allowed to execute '/sbin/reboot ' As Root on Localhost.localdomain. [[email protected] ~]$ sudo useradd test[sudo] password for kang: [[email protected] ~]$ tail-2/etc/passwdkang : x:501:502::/home/kang:/bin/bashtest:x:502:503::/home/test:/bin/bash[[email protected] ~]# visudo-c #配置文语法检查 /etc/sudoers:pArsed OK 
User aliases, command alias usage tips
[[email protected] ~]# visudo User_Alias ADMIN = kang, test                 #ADMIN包括了用户kang, test Cmnd_Alias USERCMD = /usr/sbin/useradd                  #USERCMD包括可用useradd命令权限Cmnd_Alias NETWORKCMD = /sbin/ifconfig,/etc/init.d/network           #NETWORKCMD命令包括ifconfig/network命令ADMIN       ALL=(ALL)     USERCMD, NETWORKCMD               #授权用户命令使用
Remark explanation use
root                     ALL=(ALL)                    ALL用户/组               机器=角色                    命令# User_Alias ADMINS = jsmith, mikem# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig

Linux User management rights Visudo

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.