Advertisement
haryono94

/etc/sudoers

Sep 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.01 KB | None | 0 0
  1. [root@GCMONDRC1 ~]# cat /etc/sudoers
  2. ## Sudoers allows particular users to run various commands as
  3. ## the root user, without needing the root password.
  4. ##
  5. ## Examples are provided at the bottom of the file for collections
  6. ## of related commands, which can then be delegated out to particular
  7. ## users or groups.
  8. ##
  9. ## This file must be edited with the 'visudo' command.
  10.  
  11. ## Host Aliases
  12. ## Groups of machines. You may prefer to use hostnames (perhaps using
  13. ## wildcards for entire domains) or IP addresses instead.
  14. # Host_Alias     FILESERVERS = fs1, fs2
  15. # Host_Alias     MAILSERVERS = smtp, smtp2
  16.  
  17. ## User Aliases
  18. ## These aren't often necessary, as you can use regular groups
  19. ## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
  20. ## rather than USERALIAS
  21. # User_Alias ADMINS = jsmith, mikem
  22.  
  23.  
  24. ## Command Aliases
  25. ## These are groups of related commands...
  26.  
  27. ## Networking
  28. # Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool
  29.  
  30. ## Installation and management of software
  31. # Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum
  32.  
  33. ## Services
  34. # Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig, /usr/bin/systemctl start, /usr/bin/systemctl stop, /usr/bin/systemctl reload, /usr/bin/systemctl restart, /usr/bin/systemctl status, /usr/bin/systemctl enable, /usr/bin/systemctl disable
  35.  
  36. ## Updating the locate database
  37. # Cmnd_Alias LOCATE = /usr/bin/updatedb
  38.  
  39. ## Storage
  40. # Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount
  41.  
  42. ## Delegating permissions
  43. # Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp
  44.  
  45. ## Processes
  46. # Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall
  47.  
  48. ## Drivers
  49. # Cmnd_Alias DRIVERS = /sbin/modprobe
  50.  
  51. # Defaults specification
  52.  
  53. #
  54. # Refuse to run if unable to disable echo on the tty.
  55. #
  56. Defaults   !visiblepw
  57.  
  58. #
  59. # Preserving HOME has security implications since many programs
  60. # use it when searching for configuration files. Note that HOME
  61. # is already set when the the env_reset option is enabled, so
  62. # this option is only effective for configurations where either
  63. # env_reset is disabled or HOME is present in the env_keep list.
  64. #
  65. Defaults    always_set_home
  66. Defaults    match_group_by_gid
  67.  
  68. Defaults    env_reset
  69. Defaults    env_keep =  "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS"
  70. Defaults    env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
  71. Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
  72. Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
  73. Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
  74.  
  75. #
  76. # Adding HOME to env_keep may enable a user to run unrestricted
  77. # commands via sudo.
  78. #
  79. # Defaults   env_keep += "HOME"
  80.  
  81. Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin
  82.  
  83. ## Next comes the main part: which users can run what software on
  84. ## which machines (the sudoers file can be shared between multiple
  85. ## systems).
  86. ## Syntax:
  87. ##
  88. ##  user    MACHINE=COMMANDS
  89. ##
  90. ## The COMMANDS section may have other options added to it.
  91. ##
  92. ## Allow root to run any commands anywhere
  93. root    ALL=(ALL)   ALL
  94.  
  95. ## Allows members of the 'sys' group to run networking, software,
  96. ## service management apps and more.
  97. # %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
  98.  
  99. ## Allows people in group wheel to run all commands
  100. %wheel  ALL=(ALL)   ALL
  101.  
  102. ## Same thing without a password
  103. # %wheel    ALL=(ALL)   NOPASSWD: ALL
  104.  
  105. ## Allows members of the users group to mount and unmount the
  106. ## cdrom as root
  107. # %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom
  108.  
  109. ## Allows members of the users group to shutdown this system
  110. # %users  localhost=/sbin/shutdown -h now
  111.  
  112. ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
  113. #includedir /etc/sudoers.d
  114. [root@GCMONDRC1 ~]#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement