Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| rh124_sudo [2026/10/23 09:56] – [Abbreviated /etc/sudoers] rpjday | rh124_sudo [2026/10/30 12:09] (current) – [Links] rpjday | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| //" | //" | ||
| + | ===== Links ===== | ||
| + | |||
| + | * [[https:// | ||
| + | * [[www.geeksforgeeks.org/ | ||
| + | * [[https:// | ||
| ===== The " | ===== The " | ||
| - | All members of the '' | + | All members of the '' |
| - | ===== Very abbreviated /etc/sudoers ===== | + | ===== Using the same sudoers |
| - | You can use the same ''/ | + | You can use the same ''/ |
| + | |||
| + | ===== General format of sudoers line ===== | ||
| + | |||
| + | < | ||
| + | username hostname = (run_as_user: | ||
| + | </ | ||
| + | |||
| + | Examples: | ||
| + | |||
| + | < | ||
| + | username ALL=(ALL: | ||
| + | username ALL=(ALL) ALL | ||
| + | %groupname ALL=(ALL) NOPASSWD: ALL | ||
| + | %groupname ALL=(ALL) NOPASSWD: / | ||
| + | %groupname host1, | ||
| + | username host_alias=(ALL) ALL | ||
| + | </ | ||
| + | |||
| + | ===== Very abbreviated / | ||
| Note much of this file is commented out. | Note much of this file is commented out. | ||
| Line 31: | Line 55: | ||
| ## rather than USERALIAS | ## rather than USERALIAS | ||
| # User_Alias ADMINS = jsmith, mikem | # User_Alias ADMINS = jsmith, mikem | ||
| - | |||
| ## Command Aliases | ## Command Aliases | ||
| Line 60: | Line 83: | ||
| # Cmnd_Alias DRIVERS = / | # Cmnd_Alias DRIVERS = / | ||
| - | # Defaults specification | + | ... big snip ... |
| - | + | ||
| - | # | + | |
| - | # Refuse to run if unable to disable echo on the tty. | + | |
| - | # | + | |
| - | Defaults | + | |
| - | + | ||
| - | # | + | |
| - | # Preserving HOME has security implications since many programs | + | |
| - | # use it when searching for configuration files. Note that HOME | + | |
| - | # is already set when the the env_reset option is enabled, so | + | |
| - | # this option is only effective for configurations where either | + | |
| - | # env_reset is disabled or HOME is present in the env_keep list. | + | |
| - | # | + | |
| - | Defaults | + | |
| - | Defaults | + | |
| - | + | ||
| - | # Prior to version 1.8.15, groups listed in sudoers that were not | + | |
| - | # found in the system group database were passed to the group | + | |
| - | # plugin, if any. Starting with 1.8.15, only groups of the form | + | |
| - | # %:group are resolved via the group plugin by default. | + | |
| - | # We enable always_query_group_plugin to restore old behavior. | + | |
| - | # Disable this option for new behavior. | + | |
| - | Defaults | + | |
| - | + | ||
| - | Defaults | + | |
| - | Defaults | + | |
| - | Defaults | + | |
| - | Defaults | + | |
| - | Defaults | + | |
| - | Defaults | + | |
| - | + | ||
| - | # | + | |
| - | # Adding HOME to env_keep may enable a user to run unrestricted | + | |
| - | # commands via sudo. | + | |
| - | # | + | |
| - | # Defaults | + | |
| - | + | ||
| - | Defaults | + | |
| ## Next comes the main part: which users can run what software on | ## Next comes the main part: which users can run what software on | ||
| Line 131: | Line 116: | ||
| ## Read drop-in files from / | ## Read drop-in files from / | ||
| #includedir / | #includedir / | ||
| + | </ | ||
| + | Note well the final ''# | ||
| + | |||
| + | ===== Giving the class sudo access ===== | ||
| + | |||
| + | ==== Option 1 ==== | ||
| + | |||
| + | Add all class accounts to the '' | ||
| + | |||
| + | ==== Option 2 ==== | ||
| + | |||
| + | Create a new group, '' | ||
| + | |||
| + | < | ||
| + | %class ALL=(ALL) ALL | ||
| + | %class ALL=(ALL) NOPASSWD: ALL | ||
| + | </ | ||
| + | |||
| + | ===== How to examine your own sudo capabilities ===== | ||
| + | |||
| + | < | ||
| + | $ sudo -l | ||
| </ | </ | ||