<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Chan Chen Coding...

    Understand sudo

    sudo  is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user (normally
    the superuser, or root). Its name is a concatenation of the sucommand (which grants the user a shell of another user, normally the superuser) and "do", or take action.
    Unlike the su command, users typically supply their own password to sudo rather than the root password. After authentication, and if the /etc/sudoers configuration file
    permits the user access, then the system will invoke the requested command.



    #
    # Sample /etc/sudoers file.
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # See the sudoers man page for the details on how to write a sudoers file.
    #

    ##
    # User alias specification
    ##
    User_Alias    FULLTIMERS = millert, mikef, dowdy
    User_Alias    PARTTIMERS = bostley, jwfox, crawl
    User_Alias    WEBMASTERS = will, wendy, wim

    ##
    # Runas alias specification
    ##
    Runas_Alias    OP = root, operator
    Runas_Alias    DB = oracle, sybase

    ##
    # Host alias specification
    ##
    Host_Alias    SPARC = bigtime, eclipse, moet, anchor:\
            SGI = grolsch, dandelion, black:\
            ALPHA = widget, thalamus, foobar:\
            HPPA = boa, nag, python
    Host_Alias    CUNETS = 128.138.0.0/255.255.0.0
    Host_Alias    CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0
    Host_Alias    SERVERS = master, mail, www, ns
    Host_Alias    CDROM = orion, perseus, hercules

    ##
    # Cmnd alias specification
    ##
    Cmnd_Alias    DUMPS = /usr/sbin/dump, /usr/sbin/rdump, /usr/sbin/restore, \
                /usr/sbin/rrestore, /usr/bin/mt
    Cmnd_Alias    KILL = /usr/bin/kill
    Cmnd_Alias    PRINTING = /usr/sbin/lpc, /usr/bin/lprm
    Cmnd_Alias    SHUTDOWN = /usr/sbin/shutdown
    Cmnd_Alias    HALT = /usr/sbin/halt, /usr/sbin/fasthalt
    Cmnd_Alias    REBOOT = /usr/sbin/reboot, /usr/sbin/fastboot
    Cmnd_Alias    SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \
                 /usr/local/bin/tcsh, /usr/bin/rsh, \
                 /usr/local/bin/zsh
    Cmnd_Alias    SU = /usr/bin/su
    Cmnd_Alias    VIPW = /usr/sbin/vipw, /usr/bin/passwd, /usr/bin/chsh, \
                   /usr/bin/chfn

    ##
    # Override built-in defaults
    ##
    Defaults               syslog=auth
    Defaults:FULLTIMERS    !lecture
    Defaults:millert       !authenticate
    Defaults@SERVERS       log_year, logfile=/var/log/sudo.log

    ##
    # User specification
    ##

    # root and users in group wheel can run anything on any machine as any user
    root        ALL = (ALL) ALL
    %wheel        ALL = (ALL) ALL

    # full time sysadmins can run anything on any machine without a password
    FULLTIMERS    ALL = NOPASSWD: ALL

    # part time sysadmins may run anything but need a password
    PARTTIMERS    ALL = ALL

    # jack may run anything on machines in CSNETS
    jack        CSNETS = ALL

    # lisa may run any command on any host in CUNETS (a class B network)
    lisa        CUNETS = ALL

    # operator may run maintenance commands and anything in /usr/oper/bin/
    operator    ALL = DUMPS, KILL, PRINTING, SHUTDOWN, HALT, REBOOT,\
            /usr/oper/bin/

    # joe may su only to operator
    joe        ALL = /usr/bin/su operator

    # pete may change passwords for anyone but root on the hp snakes
    pete        HPPA = /usr/bin/passwd [A-z]*, !/usr/bin/passwd root

    # bob may run anything on the sparc and sgi machines as any user
    # listed in the Runas_Alias "OP" (ie: root and operator)
    bob        SPARC = (OP) ALL : SGI = (OP) ALL

    # jim may run anything on machines in the biglab netgroup
    jim        +biglab = ALL

    # users in the secretaries netgroup need to help manage the printers
    # as well as add and remove users
    +secretaries    ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser

    # fred can run commands as oracle or sybase without a password
    fred        ALL = (DB) NOPASSWD: ALL

    # on the alphas, john may su to anyone but root and flags are not allowed
    john        ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*

    # jen can run anything on all machines except the ones
    # in the "SERVERS" Host_Alias
    jen        ALL, !SERVERS = ALL

    # jill can run any commands in the directory /usr/bin/, except for
    # those in the SU and SHELLS aliases.
    jill        SERVERS = /usr/bin/, !SU, !SHELLS

    # steve can run any command in the directory /usr/local/op_commands/
    # as user operator.
    steve        CSNETS = (operator) /usr/local/op_commands/

    # matt needs to be able to kill things on his workstation when
    # they get hung.
    matt        valkyrie = KILL

    # users in the WEBMASTERS User_Alias (will, wendy, and wim)
    # may run any command as user www (which owns the web pages)
    # or simply su to www.
    WEBMASTERS    www = (www) ALL, (root) /usr/bin/su www

    # anyone can mount/unmount a cd-rom on the machines in the CDROM alias
    ALL        CDROM = NOPASSWD: /sbin/umount /CDROM,\
            /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM

     



    -----------------------------------------------------
    Silence, the way to avoid many problems;
    Smile, the way to solve many problems;

    posted on 2012-06-12 02:04 Chan Chen 閱讀(155) 評論(0)  編輯  收藏 所屬分類: Linux

    主站蜘蛛池模板: 97在线视频免费| 老司机精品免费视频| 午夜免费福利片观看| 国产成人亚洲精品| 久久大香香蕉国产免费网站| 亚洲精品自产拍在线观看| 国产成人无码精品久久久免费| 亚洲国产成人影院播放| 亚洲AV日韩AV鸥美在线观看| 2022国内精品免费福利视频 | 亚洲国产精品线观看不卡 | 91精品手机国产免费| 久久久久无码精品亚洲日韩 | 免费看一级一级人妻片| 99国产精品免费观看视频| 在线观着免费观看国产黄| 亚洲欧美日本韩国| 国产男女猛烈无遮挡免费视频| 亚洲av色香蕉一区二区三区 | 免费无码又爽又刺激聊天APP| 中文字幕亚洲男人的天堂网络| 69成人免费视频无码专区| 亚洲国产成人久久精品软件 | 国产成人精品日本亚洲18图| 在线精品免费视频无码的| 免费人成大片在线观看播放| 伊人久久大香线蕉亚洲五月天| 一级毛片免费不卡在线| 亚洲一区二区影视| 国产女高清在线看免费观看| 伊人久久大香线蕉免费视频| 国产国产人免费视频成69大陆| 黄床大片30分钟免费看| 亚洲av午夜成人片精品网站| 国产免费不卡v片在线观看| 久久精品国产亚洲夜色AV网站| 91视频免费网址| 亚洲精品女同中文字幕| 亚洲中文字幕第一页在线| 中文字幕亚洲免费无线观看日本| 亚洲熟妇AV一区二区三区宅男|