zoukankan      html  css  js  c++  java
  • sudo命令 sudoers文件

    超级用户权限

    # Host alias specification
    Host_Alias  HA = 192.168.1.1, 192.168.1.2
    
    # User alias specification
    User_Alias  UA = thomas, tammy
    
    # Cmnd alias specification
    Cmnd_Alias  CA = /usr/sbin/arp, /usr/bin/yes
    
    # User privilege specification
    root    ALL=(ALL:ALL) ALL
    
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL
    
    # Allow members of group sudo to execute any command
    %sudo   ALL=(ALL:ALL) ALL

    授权规则含义

    root ALL=(ALL:ALL) ALL
    用户名

    root ALL=(ALL:ALL) ALL
    主机名

    root ALL=(ALL:ALL) ALL
    目标用户:组,以谁的身份去执行。如果没省略,必须使用( )包含起来

    root ALL=(ALL:ALL) ALL
    命令

    别名定义

    Host_Alias:主机的列表
    User_Alias:具有sudo权限的用户的列表
    Cmnd_Alias:允许执行的命令的列表

    通配符和取消命令

    thomas  ALL=/usr/sbin/*,!/usr/sbin/arp

    举例

    thomas  ALL=(ALL:ALL) NOPASSWD:ALL //免密
    thomas  HA=(ALL:ALL) ALL //Host alias
    UA  ALL=(ALL:ALL) ALL   //User alias
    thomas  ALL=(ALL:ALL) CA    //Cmnd alias
  • 相关阅读:
    $prufer$序列
    倍增
    二分
    英语词汇速查表
    ACM模拟赛
    Trie树
    关于军训的模拟赛-R2
    树上差分
    列队
    斜率优化dp
  • 原文地址:https://www.cnblogs.com/zhangxuechao/p/11709692.html
Copyright © 2011-2022 走看看