Advertisement
ManyolElek

Red Hat

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