{
    "mode": "man",
    "parameter": "sudoers",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/sudoers/5/json",
    "generated": "2026-11-07T21:56:08Z",
    "sections": {
        "NAME": {
            "content": "sudoers — default sudo security policy plugin\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The sudoers policy plugin determines a user's sudo privileges.  It is the default sudo policy\nplugin.   The  policy is driven by the /etc/sudoers file or, optionally, in LDAP.  The policy\nformat is described in detail in the “SUDOERS FILE FORMAT” section.  For information on stor‐\ning sudoers policy information in LDAP, see sudoers.ldap(5).\n",
            "subsections": [
                {
                    "name": "Configuring sudo.conf for sudoers",
                    "content": "sudo consults the sudo.conf(5) file to determine which plugins to load.  If  no  sudo.conf(5)\nfile is present, or if it contains no Plugin lines, sudoers will be used for auditing, policy\ndecisions  and  I/O logging.  To explicitly configure sudo.conf(5) to use the sudoers plugin,\nthe following configuration can be used.\n\nPlugin sudoersaudit sudoers.so\nPlugin sudoerspolicy sudoers.so\nPlugin sudoersio sudoers.so\n\nStarting with sudo 1.8.5, it is possible to specify optional arguments to the sudoers  plugin\nin  the  sudo.conf(5) file.  Plugin arguments, if any, should be listed after the path to the\nplugin (i.e., after sudoers.so).  The arguments are only effective for the plugin that  opens\n(and parses) the sudoers file.\n\nFor  sudo version 1.9.1 and higher, this is the sudoersaudit plugin.  For older versions, it\nis the sudoerspolicy plugin.  Multiple arguments may be specified, separated by white space.\nFor example:\n\nPlugin sudoersaudit sudoers.so sudoersmode=0400 errorrecovery=false\n\nThe following plugin arguments are supported:\n\nerrorrecovery=bool\nThe errorrecovery argument can be used to control whether sudoers  should  attempt  to\nrecover  from syntax errors in the sudoers file.  If set to true (the default), sudoers\nwill try to recover from a syntax error by discarding the portion of the line that con‐\ntains the error until the end of the line.  A value of false will disable error  recov‐\nery.  Prior to version 1.9.3, no error recovery was performed.\n\nignoreperms=bool\nThe  ignoreperms  argument  can  be  used  to disable security checks when loading the\nsudoers file.  If enabled, the sudoers file will be loaded regardless of the  owner  or\nfile mode.  This argument is intended to be used for testing purposes and should not be\nenabled on production systems.\n\nldapconf=pathname\nThe ldapconf argument can be used to override the default path to the ldap.conf file.\n\nldapsecret=pathname\nThe  ldapsecret  argument  can be used to override the default path to the ldap.secret\nfile.\n\nsudoersfile=pathname\nThe sudoersfile argument can be used to override the default path to the sudoers file.\n\nsudoersuid=user-ID\nThe sudoersuid argument can be used to override the default owner of the sudoers file.\nIt should be specified as a numeric user-ID.\n\nsudoersgid=group-ID\nThe sudoersgid argument can be used to override the default group of the sudoers file.\nIt must be specified as a numeric group-ID (not a group name).\n\nsudoersmode=mode\nThe sudoersmode argument can be used to override the default file mode for the sudoers\nfile.  It should be specified as an octal value.\n\nFor more information on configuring sudo.conf(5), refer to its manual.\n"
                },
                {
                    "name": "User Authentication",
                    "content": "The sudoers security policy requires that most users authenticate themselves before they  can\nuse sudo.  A password is not required if the invoking user is root, if the target user is the\nsame  as the invoking user, or if the policy has disabled authentication for the user or com‐\nmand.  Unlike su(1), when sudoers requires authentication, it validates the  invoking  user's\ncredentials,  not  the  target  user's  (or root's) credentials.  This can be changed via the\nrootpw, targetpw and runaspw flags, described later.\n\nIf a user who is not listed in the policy tries to run a command via sudo, mail  is  sent  to\nthe  proper  authorities.   The address used for such mail is configurable via the mailto De‐\nfaults entry (described later) and defaults to root.\n\nNo mail will be sent if an unauthorized user tries to run sudo with the -l or -v  option  un‐\nless  there  is  an authentication error and either the mailalways or mailbadpass flags are\nenabled.  This allows users to determine for themselves whether or not they  are  allowed  to\nuse sudo.  By default, all attempts to run sudo (successful or not) are logged, regardless of\nwhether or not mail is sent.\n\nIf sudo is run by root and the SUDOUSER environment variable is set, the sudoers policy will\nuse  this  value to determine who the actual user is.  This can be used by a user to log com‐\nmands through sudo even when a root shell has been invoked.  It also allows the -e option  to\nremain  useful  even  when invoked via a sudo-run script or program.  Note, however, that the\nsudoers file lookup is still done for root, not the user specified by SUDOUSER.\n\nsudoers uses per-user time stamp files for credential caching.  Once a user has been  authen‐\nticated, a record is written containing the user-ID that was used to authenticate, the termi‐\nnal  session  ID,  the  start time of the session leader (or parent process) and a time stamp\n(using a monotonic clock if one is available).  The user may then use sudo without a password\nfor a short period of time (15 minutes unless overridden by  the  timestamptimeout  option).\nBy default, sudoers uses a separate record for each terminal, which means that a user's login\nsessions  are  authenticated separately.  The timestamptype option can be used to select the\ntype of time stamp record sudoers will use.\n"
                },
                {
                    "name": "Logging",
                    "content": "By default, sudoers logs both successful and unsuccessful attempts (as well as errors).   The\nlogallowed  and  logdenied  flags  can  be  used to control this behavior.  Messages can be\nlogged to syslog(3), a log file, or both.  The default is to log to  syslog(3)  but  this  is\nconfigurable  via  the syslog and logfile settings.  See “EVENT LOGGING” for a description of\nthe log file format.\n\nsudoers is also capable of running a command in a pseudo-terminal and  logging  input  and/or\noutput.   The standard input, standard output, and standard error can be logged even when not\nassociated with a terminal.  For more information about I/O logging, see  the  “I/O  LOGGING”\nsection.\n\nStarting with version 1.9, the logservers setting may be used to send event and I/O log data\nto  a  remote server running sudologsrvd or another service that implements the protocol de‐\nscribed by sudologsrv.proto(5).\n"
                },
                {
                    "name": "Command environment",
                    "content": "Since environment variables can influence program behavior, sudoers provides a means  to  re‐\nstrict  which  variables  from the user's environment are inherited by the command to be run.\nThere are two distinct ways sudoers can deal with environment variables.\n\nBy default, the envreset flag is enabled.  This causes commands to be executed with  a  new,\nminimal  environment.  On AIX (and Linux systems without PAM), the environment is initialized\nwith the contents of the /etc/environment file.  The HOME, MAIL, SHELL, LOGNAME and USER  en‐\nvironment variables are initialized based on the target user and the SUDO* variables are set\nbased  on  the invoking user.  Additional variables, such as DISPLAY, PATH and TERM, are pre‐\nserved from the invoking user's environment if permitted by the envcheck,  or  envkeep  op‐\ntions.   A  few  environment variables are treated specially.  If the PATH and TERM variables\nare not preserved from the user's environment, they will  be  set  to  default  values.   The\nLOGNAME  and  USER  are handled as a single entity.  If one of them is preserved (or removed)\nfrom the user's environment, the other will be as well.  If LOGNAME and USER are to  be  pre‐\nserved  but  only  one of them is present in the user's environment, the other will be set to\nthe same value.  This avoids an inconsistent environment where one of the variables  describ‐\ning the user name is set to the invoking user and one is set to the target user.  Environment\nvariables  with  a value beginning with ‘()’ are removed unless both the name and value parts\nare matched by envkeep or envcheck, as they may be interpreted as  functions  by  the  bash\nshell.  Prior to version 1.8.11, such variables were always removed.\n\nIf,  however,  the  envreset  flag  is  disabled, any variables not explicitly denied by the\nenvcheck and envdelete options are allowed and their values are inherited from the invoking\nprocess.  Prior to version 1.8.21, environment variables with a  value  beginning  with  ‘()’\nwere always removed.  Beginning with version 1.8.21, a pattern in envdelete is used to match\nbash  shell  functions  instead.  Since it is not possible to block all potentially dangerous\nenvironment variables, use of the default envreset behavior is encouraged.\n\nEnvironment variables specified by envcheck, envdelete, or envkeep may include one or more\n‘*’ characters which will match zero or more characters.  No other  wildcard  characters  are\nsupported.\n\nBy  default,  environment variables are matched by name.  However, if the pattern includes an\nequal sign (‘=’), both the variables name and value must match.  For example,  a  bash  shell\nfunction could be matched as follows:\n\nenvkeep += \"BASHFUNCmyfunc%%=()*\"\n\nWithout the ‘=()*’ suffix, this would not match, as bash shell functions are not preserved by\ndefault.\n\nThe  complete  list  of  environment  variables that are preserved or removed, as modified by\nglobal Defaults parameters in sudoers, is displayed when sudo is run by root with the -V  op‐\ntion.   The list of environment variables to remove varies based on the operating system sudo\nis running on.\n\nOther settings may influence the command environment:\n\n•  sudoers options such as alwayssethome, securepath, setlogname, sethome, and setenv.\n\n•  Command tags, such as SETENV and NOSETENV.  Note that SETENV is  implied  if  the  command\nmatched is ALL.\n\n•  sudo options, such as -E and -i.\n\nOn  systems  that  support PAM where the pamenv module is enabled for sudo, variables in the\nPAM environment may be merged in to the environment.  If a variable in the PAM environment is\nalready present in the user's environment, the value will only be overridden if the  variable\nwas not preserved by sudoers.  When envreset is enabled, variables preserved from the invok‐\ning  user's  environment  by the envkeep list take precedence over those in the PAM environ‐\nment.  When envreset is disabled, variables present the  invoking  user's  environment  take\nprecedence  over  those  in the PAM environment unless they match a pattern in the envdelete\nlist.\n\nThe dynamic linker on most operating systems will remove variables that can  control  dynamic\nlinking  from  the  environment of set-user-ID executables, including sudo.  Depending on the\noperating system this may include RLD*, DYLD*, LD*, LDR*, LIBPATH, SHLIBPATH,  and  oth‐\ners.  These type of variables are removed from the environment before sudo even begins execu‐\ntion and, as such, it is not possible for sudo to preserve them.\n\nAs a special case, if the -i option (initial login) is specified, sudoers will initialize the\nenvironment  regardless  of the value of envreset.  The DISPLAY, PATH and TERM variables re‐\nmain unchanged; HOME, MAIL, SHELL, USER, and LOGNAME are set based on the  target  user.   On\nAIX (and Linux systems without PAM), the contents of /etc/environment are also included.  All\nother  environment variables are removed unless permitted by envkeep or envcheck, described\nabove.\n\nFinally, the restrictedenvfile and envfile files are applied, if present.   The  variables\nin  restrictedenvfile are applied first and are subject to the same restrictions as the in‐\nvoking user's environment, as detailed above.  The variables in envfile are applied last and\nare not subject to these restrictions.  In both cases, variables present in  the  files  will\nonly be set to their specified values if they would not conflict with an existing environment\nvariable.\n"
                }
            ]
        },
        "SUDOERS FILE FORMAT": {
            "content": "The  sudoers file is composed of two types of entries: aliases (basically variables) and user\nspecifications (which specify who may run what).\n\nWhen multiple entries match for a user, they are applied in order.  Where there are  multiple\nmatches, the last match is used (which is not necessarily the most specific match).\n\nThe  sudoers file grammar will be described below in Extended Backus-Naur Form (EBNF).  Don't\ndespair if you are unfamiliar with EBNF; it is fairly simple, and the definitions  below  are\nannotated.\n",
            "subsections": [
                {
                    "name": "Resource limits",
                    "content": "By  default, sudoers uses the operating system's native method of setting resource limits for\nthe target user.  On Linux systems, resource limits are usually set by the pamlimits.so  PAM\nmodule.   On  some  BSD  systems,  the /etc/login.conf file specifies resource limits for the\nuser.  On AIX systems, resource limits are configured in the /etc/security/limits  file.   If\nthere  is  no system mechanism to set per-user resource limits, the command will run with the\nsame limits as the invoking user.  The one exception to this is  the  core  dump  file  size,\nwhich  is  set by sudoers to 0 by default.  Disabling core dumps by default makes it possible\nto avoid potential security problems where the core file is treated as trusted input.\n\nResource limits may also be set in the sudoers file itself, in which case they override those\nset by the system.  See the rlimitas, rlimitcore,  rlimitcpu,  rlimitdata,  rlimitfsize,\nrlimitlocks,  rlimitmemlock,  rlimitnofile, rlimitnproc, rlimitrss, rlimitstack options\ndescribed below.  Resource limits in sudoers may be specified in one of  the  following  for‐\nmats:\n\n“value”\nBoth  the soft and hard resource limits are set to the same value.  The special value\n“infinity” can be used to indicate that the value is unlimited.\n\n“soft,hard”\nTwo comma-separated values.  The soft limit is set to the first value  and  the  hard\nlimit  is  set to the second.  Both values must either be enclosed in a set of double\nquotes, or the comma must be escaped with  a  backslash  (‘\\’).   The  special  value\n“infinity” may be used in place of either value.\n\n“default”\nThe  default  resource  limit for the user will be used.  This may be a user-specific\nvalue (see above) or the value of the resource limit when sudo was invoked  for  sys‐\ntems that don't support per-user limits.\n\n“user”  The invoking user's resource limits will be preserved when running the command.\n\nFor  example, to restore the historic core dump file size behavior, a line like the following\nmay be used.\n\nDefaults rlimitcore=default\n\nResource limits in sudoers are only supported by version 1.8.7 or higher.\n"
                },
                {
                    "name": "Quick guide to EBNF",
                    "content": "EBNF is a concise and exact way of describing the grammar of a language.  Each  EBNF  defini‐\ntion is made up of production rules.  For example:\n\nsymbol ::= definition | alternate1 | alternate2 ...\n\nEach  production  rule  references others and thus makes up a grammar for the language.  EBNF\nalso contains the following operators, which many readers will recognize from regular expres‐\nsions.  Do not, however, confuse them with “wildcard” characters, which have different  mean‐\nings.\n\n?     Means that the preceding symbol (or group of symbols) is optional.  That is, it may ap‐\npear once or not at all.\n\n*     Means that the preceding symbol (or group of symbols) may appear zero or more times.\n\n+     Means that the preceding symbol (or group of symbols) may appear one or more times.\n\nParentheses  may  be  used to group symbols together.  For clarity, we will use single quotes\n('') to designate what is a verbatim character string (as opposed to a symbol name).\n"
                },
                {
                    "name": "Aliases",
                    "content": "There are four kinds of aliases: UserAlias, RunasAlias, HostAlias and CmndAlias.   Begin‐\nning with sudo 1.9.0, CmdAlias may be used in place of CmndAlias if desired.\n\nAlias ::= 'UserAlias'  UserAliasSpec (':' UserAliasSpec)* |\n'RunasAlias' RunasAliasSpec (':' RunasAliasSpec)* |\n'HostAlias'  HostAliasSpec (':' HostAliasSpec)* |\n'CmndAlias'  CmndAliasSpec (':' CmndAliasSpec)* |\n'CmdAlias'   CmndAliasSpec (':' CmndAliasSpec)*\n\nUserAlias ::= NAME\n\nUserAliasSpec ::= UserAlias '=' UserList\n\nRunasAlias ::= NAME\n\nRunasAliasSpec ::= RunasAlias '=' RunasList\n\nHostAlias ::= NAME\n\nHostAliasSpec ::= HostAlias '=' HostList\n\nCmndAlias ::= NAME\n\nCmndAliasSpec ::= CmndAlias '=' CmndList\n\nNAME ::= [A-Z]([A-Z][0-9])*\n\nEach alias definition is of the form\n\nAliasType NAME = item1, item2, ...\n\nwhere  AliasType  is one of UserAlias, RunasAlias, HostAlias, or CmndAlias.  A NAME is a\nstring of uppercase letters, numbers, and underscore characters (‘’).   A  NAME  must  start\nwith  an  uppercase letter.  It is possible to put several alias definitions of the same type\non a single line, joined by a colon (‘:’).  For example:\n\nAliasType NAME = item1, item2, item3 : NAME = item4, item5\n\nIt is a syntax error to redefine an existing alias.  It is possible to use the same name  for\naliases of different types, but this is not recommended.\n\nThe definitions of what constitutes a valid alias member follow.\n\nUserList ::= User |\nUser ',' UserList\n\nUser ::= '!'* user name |\n'!'* #user-ID |\n'!'* %group |\n'!'* %#group-ID |\n'!'* +netgroup |\n'!'* %:nonunixgroup |\n'!'* %:#nonunixgid |\n'!'* UserAlias\n\nA  UserList is made up of one or more user names, user-IDs (prefixed with ‘#’), system group\nnames and IDs (prefixed with ‘%’ and ‘%#’ respectively), netgroups (prefixed with ‘+’),  non-\nUnix  group names and IDs (prefixed with ‘%:’ and ‘%:#’ respectively), and UserAliases. Each\nlist item may be prefixed with zero or more ‘!’ operators.  An odd number  of  ‘!’  operators\nnegate  the value of the item; an even number just cancel each other out.  User netgroups are\nmatched using the user and domain members only; the host member is not used when matching.\n\nA user name, user-ID, group, group-ID, netgroup, nonunixgroup or nonunixgid may be enclosed\nin double quotes to avoid the need for escaping  special  characters.   Alternately,  special\ncharacters  may  be  specified  in escaped hex mode, e.g., \\x20 for space.  When using double\nquotes, any prefix characters must be included inside the quotes.\n\nThe actual nonunixgroup and nonunixgid syntax depends on the underlying group provider plu‐\ngin.  For instance, the QAS AD plugin supports the following formats:\n\n•  Group in the same domain: \"%:Group Name\"\n\n•  Group in any domain: \"%:Group Name@FULLY.QUALIFIED.DOMAIN\"\n\n•  Group SID: \"%:S-1-2-34-5678901234-5678901234-5678901234-567\"\n\nSee “GROUP PROVIDER PLUGINS” for more information.\n\nQuotes around group names are optional.  Unquoted strings must use a backslash (‘\\’)  to  es‐\ncape  spaces and special characters.  See “Other special characters and reserved words” for a\nlist of characters that need to be escaped.\n\nRunasList ::= RunasMember |\nRunasMember ',' RunasList\n\nRunasMember ::= '!'* user name |\n'!'* #user-ID |\n'!'* %group |\n'!'* %#group-ID |\n'!'* %:nonunixgroup |\n'!'* %:#nonunixgid |\n'!'* +netgroup |\n'!'* RunasAlias |\n'!'* ALL\n\nA RunasList is similar to a UserList except that instead of  UserAliases  it  can  contain\nRunasAliases.   User  names  and  groups  are matched as strings.  In other words, two users\n(groups) with the same user (group) ID are considered to be distinct.  If you wish  to  match\nall  user names with the same user-ID (e.g., root and toor), you can use a user-ID instead of\na name (#0 in the example given).  The user-ID or group-ID specified in a  RunasMember  need\nnot be listed in the password or group database.\n\nHostList ::= Host |\nHost ',' HostList\n\nHost ::= '!'* host name |\n'!'* ipaddr |\n'!'* network(/netmask)? |\n'!'* +netgroup |\n'!'* HostAlias |\n'!'* ALL\n\nA  HostList  is  made up of one or more host names, IP addresses, network numbers, netgroups\n(prefixed with ‘+’), and other aliases.  Again, the value of an item may be negated with  the\n‘!’ operator.  Host netgroups are matched using the host (both qualified and unqualified) and\ndomain  members  only;  the  user member is not used when matching.  If you specify a network\nnumber without a netmask, sudo will query each of the local host's network interfaces and, if\nthe network number corresponds to one of the hosts's network interfaces, will use the netmask\nof that interface.  The netmask may be specified  either  in  standard  IP  address  notation\n(e.g., 255.255.255.0 or ffff:ffff:ffff:ffff::), or CIDR notation (number of bits, e.g., 24 or\n64).   A host name may include shell-style wildcards (see the “Wildcards” section below), but\nunless the hostname command on your machine returns the fully  qualified  host  name,  you'll\nneed  to use the fqdn flag for wildcards to be useful.  sudo only inspects actual network in‐\nterfaces; this means that IP address 127.0.0.1 (localhost) will never match.  Also, the  host\nname  “localhost”  will only match if that is the actual host name, which is usually only the\ncase for non-networked systems.\n\ndigest ::= [A-Fa-f0-9]+ |\n[A-Za-z0-9\\+/=]+\n\nDigestSpec ::= \"sha224\" ':' digest |\n\"sha256\" ':' digest |\n\"sha384\" ':' digest |\n\"sha512\" ':' digest\n\nDigestList ::= DigestSpec |\nDigestSpec ',' DigestList\n\nCmndList ::= Cmnd |\nCmnd ',' CmndList\n\ncommand name ::= regex |\nfile name\n\ncommand ::= command name |\ncommand name args |\ncommand name regex |\ncommand name '\"\"' |\nALL\n\nEditSpec ::= \"sudoedit\" file name+ |\n\"sudoedit\" regex |\n\"sudoedit\"\n\nListSpec ::= \"list\"\n\nCmnd ::= DigestList? '!'* command |\n'!'* directory |\n'!'* EditSpec |\n'!'* ListSpec |\n'!'* CmndAlias\n\nA CmndList is a list of one or more commands, directories, or aliases.  A command is a fully\nqualified file name, which may include shell-style wildcards (see the “Wildcards” section be‐\nlow), or a regular expression that starts with ‘^’  and  ends  with  ‘$’  (see  the  “Regular\nexpressions”  section  below).   A  directory is a fully qualified path name ending in a ‘/’.\nWhen you specify a directory in a CmndList, the user will be able to  run  any  file  within\nthat  directory  (but  not in any sub-directories therein).  If no command line arguments are\nspecified, the user may run the command with any arguments they choose.  Command  line  argu‐\nments  can  include  wildcards  or be a regular expression that starts with ‘^’ and ends with\n‘$’.  If the command line arguments consist of ‘\"\"’, the command may only be run with no  ar‐\nguments.\n\nIf  a  Cmnd has associated command line arguments, the arguments in the Cmnd must match those\ngiven by the user on the command line.  If the arguments in a Cmnd begin with the ‘^’ charac‐\nter, they will be interpreted as a regular expression and  matched  accordingly.   Otherwise,\nshell-style  wildcards are used when matching.  Unless a regular expression is specified, the\nfollowing characters must be escaped with a ‘\\’ if they are used in command  arguments:  ‘,’,\n‘:’, ‘=’, ‘\\’.  To prevent arguments in a Cmnd that begin with a ‘^’ character from being in‐\nterpreted as a regular expression, the ‘^’ must be escaped with a ‘\\’.\n\nThere are two commands built into sudo itself: “list” and “sudoedit”.  Unlike other commands,\nthese two must be specified in the sudoers file without a leading path.\n\nThe  “list”  built-in  can  be  used  to permit a user to list another user's privileges with\nsudo's -U option.  For example, “sudo -l -U otheruser”.  A user with the “list” privilege  is\nable  to list another user's privileges even if they don't have permission to run commands as\nthat user.  By default, only root or a user with the ability to run  any  command  as  either\nroot  or the specified user on the current host may use the -U option.  No command line argu‐\nments may be specified with the “list” built-in.\n\nThe “sudoedit” built-in is used to permit a user to run  sudo  with  the  -e  option  (or  as\nsudoedit).   It  may take command line arguments just as a normal command does.  Unlike other\ncommands, “sudoedit” is built into sudo itself and must be  specified  in  the  sudoers  file\nwithout  a  leading  path.   If a leading path is present, for example /usr/bin/sudoedit, the\npath name will be silently converted to “sudoedit”.  A fully-qualified path for  sudoedit  is\ntreated as an error by visudo.\n\nA command may be preceded by a DigestList, a comma-separated list of one or more DigestSpec\nentries.   If a DigestList is present, the command will only match successfully if it can be\nverified using one of the SHA-2 digests in the list.  Starting with version  1.9.0,  the  ALL\nreserved  word  can  be used in conjunction with a DigestList.  The following digest formats\nare supported: sha224, sha256, sha384, and sha512.  The string may be specified in either hex\nor base64 format (base64 is more compact).  There are several utilities capable of generating\nSHA-2 digests in hex  format  such  as  openssl,  shasum,  sha224sum,  sha256sum,  sha384sum,\nsha512sum.\n\nFor example, using openssl:\n\n$ openssl dgst -sha224 /bin/ls\nSHA224(/bin/ls)= 118187da8364d490b4a7debbf483004e8f3e053ec954309de2c41a25\n\nIt is also possible to use openssl to generate base64 output:\n\n$ openssl dgst -binary -sha224 /bin/ls | openssl base64\nEYGH2oNk1JC0p9679IMATo8+BT7JVDCd4sQaJQ==\n\nWarning, if the user has write access to the command itself (directly or via a sudo command),\nit  may  be possible for the user to replace the command after the digest check has been per‐\nformed but before the command is executed.  A similar race condition exists on  systems  that\nlack  the  fexecve(2)  system  call  when  the  directory  in which the command is located is\nwritable by the user.  See the description of the fdexec setting for more information on  how\nsudo executes commands that have an associated digest.\n\nCommand digests are only supported by version 1.8.7 or higher.\n"
                },
                {
                    "name": "Defaults",
                    "content": "Certain configuration options may be changed from their default values at run-time via one or\nmore  DefaultEntry lines.  These may affect all users on any host (‘Defaults’), all users on\na specific host (‘Defaults@host’), a specific  user  (‘Defaults:user’),  a  specific  command\n(‘Defaults!cmnd’), or commands being run as a specific user (‘Defaults>runasuser’).\n\nWhite  space  is  not  permitted between ‘Defaults’ and the ‘@’, ‘:’, ‘!’, or ‘>’ characters.\nWhile a comma-separated list may be used in place of a single value after the ‘@’, ‘:’,  ‘!’,\nor ‘>’ character, using an alias instead of a list is often improve readability.  Per-command\nentries  may  not include command line arguments.  If you need to specify arguments, define a\nCmndAlias and reference that instead.\n\nDefaultType ::= 'Defaults' |\n'Defaults@' HostList |\n'Defaults:' UserList |\n'Defaults!' CmndList |\n'Defaults>' RunasList\n\nDefaultEntry ::= DefaultType ParameterList\n\nParameterList ::= Parameter |\nParameter ',' ParameterList\n\nParameter ::= Parameter '=' Value |\nParameter '+=' Value |\nParameter '-=' Value |\n'!'* Parameter\n\nParameters may be flags, integer values, strings, or lists.  Flags are implicitly boolean and\ncan be turned off via the ‘!’ operator.  Some integer, string and list parameters may also be\nused in a boolean context to disable them.  Values may be enclosed in double quotes (\"\") when\nthey contain multiple words.  Special characters may be escaped with a backslash (‘\\’).\n\nTo include a literal backslash character in a command line argument you must escape the back‐\nslash twice.  For example, to match ‘\\n’ as part of a command line  argument,  you  must  use\n‘\\\\\\\\n’  in  the sudoers file.  This is due to there being two levels of escaping, one in the\nsudoers parser itself and another when command line arguments are matched by  the  fnmatch(3)\nor regexec(3) function.\n\nLists  have  two additional assignment operators, ‘+=’ and ‘-=’.  These operators are used to\nadd to and delete from a list respectively.  It is not an error to use the ‘-=’  operator  to\nremove an element that does not exist in a list.\n\nDefaults  entries  are  parsed in the following order: global, host, user, and runas Defaults\nfirst, then command defaults.  If there are multiple Defaults settings of the same type,  the\nlast  matching setting is used.  The following Defaults settings are parsed before all others\nsince they may affect subsequent entries: fqdn, groupplugin, runasdefault, sudoerslocale.\n\nSee “SUDOERS OPTIONS” for a list of supported Defaults parameters.\n"
                },
                {
                    "name": "User specification",
                    "content": "UserSpec ::= UserList HostList '=' CmndSpecList \\\n(':' HostList '=' CmndSpecList)*\n\nCmndSpecList ::= CmndSpec |\nCmndSpec ',' CmndSpecList\n\nCmndSpec ::= RunasSpec? OptionSpec* (TagSpec ':')* Cmnd\n\nRunasSpec ::= '(' RunasList? (':' RunasList)? ')'\n\nOptionSpec ::= (SELinuxSpec | DateSpec | TimeoutSpec | ChdirSpec | ChrootSpec)\n\nSELinuxSpec ::= ('ROLE=role' | 'TYPE=type')\n\nAppArmorSpec ::= 'APPARMORPROFILE=profile'\n\nDateSpec ::= ('NOTBEFORE=timestamp' | 'NOTAFTER=timestamp')\n\nTimeoutSpec ::= 'TIMEOUT=timeout'\n\nChdirSpec ::= 'CWD=directory'\n\nChrootSpec ::= 'CHROOT=directory'\n\nTagSpec ::= ('EXEC' | 'NOEXEC' | 'FOLLOW' | 'NOFOLLOW' |\n'LOGINPUT' | 'NOLOGINPUT' | 'LOGOUTPUT' |\n'NOLOGOUTPUT' | 'MAIL' | 'NOMAIL' | 'INTERCEPT' |\n'NOINTERCEPT' | 'PASSWD' | 'NOPASSWD' | 'SETENV' |\n'NOSETENV')\n\nA user specification determines which commands a user may run (and as what user) on specified\nhosts.  By default, commands are run as root (unless runasdefault has been set to a  differ‐\nent value) but this can also be changed on a per-command basis.\n\nThe  basic  structure  of  a user specification is “who where = (aswhom) what”.  Let's break\nthat down into its constituent parts:\n"
                },
                {
                    "name": "Runas_Spec",
                    "content": "A RunasSpec determines the user and/or the group that a command may be  run  as.   A  fully-\nspecified  RunasSpec  consists  of  two  RunasLists (as defined above) separated by a colon\n(‘:’) and enclosed in a set of parentheses.  The first RunasList indicates which  users  the\ncommand  may  be  run  as via the -u option.  The second defines a list of groups that may be\nspecified via the -g option (in addition to any  of  the  target  user's  groups).   If  both\nRunasLists  are  specified,  the command may be run with any combination of users and groups\nlisted in their respective RunasLists. If only the first is specified, the  command  may  be\nrun  as  any user in the list and, optionally, with any group the target user belongs to.  If\nthe first RunasList is empty but the second is specified, the command may be run as the  in‐\nvoking  user  with  the  group  set to any listed in the RunasList.  If both RunasLists are\nempty, the command may only be run as the invoking user and the group, if specified, must  be\none  that  the  invoking user is a member of.  If no RunasSpec is specified, the command may\nonly be run as the runasdefault user (root by default) and the group, if specified, must  be\none that the runasdefault user is a member of.\n\nA  RunasSpec  sets the default for the commands that follow it.  What this means is that for\nthe entry:\n\ndgb     boulder = (operator) /bin/ls, /bin/kill, /usr/bin/lprm\n\nThe user dgb may run /bin/ls, /bin/kill, and /usr/bin/lprm on the host  boulder—but  only  as\noperator.  For example:\n\n$ sudo -u operator /bin/ls\n\nIt  is  also  possible to override a RunasSpec later on in an entry.  If we modify the entry\nlike so:\n\ndgb     boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm\n\nThen user dgb is now allowed to run /bin/ls as operator, but /bin/kill and  /usr/bin/lprm  as\nroot.\n\nWe can extend this to allow dgb to run /bin/ls with either the user or group set to operator:\n\ndgb     boulder = (operator : operator) /bin/ls, (root) /bin/kill,\\\n/usr/bin/lprm\n\nWhile the group portion of the RunasSpec permits the user to run as command with that group,\nit  does not force the user to do so.  If no group is specified on the command line, the com‐\nmand will run with the group listed in the target user's password database entry.   The  fol‐\nlowing would all be permitted by the sudoers entry above:\n\n$ sudo -u operator /bin/ls\n$ sudo -u operator -g operator /bin/ls\n$ sudo -g operator /bin/ls\n\nIn  the following example, user tcm may run commands that access a modem device file with the\ndialer group.\n\ntcm     boulder = (:dialer) /usr/bin/tip, /usr/bin/cu,\\\n/usr/local/bin/minicom\n\nIn this example only the group will be set, the command still runs as user tcm.  For example:\n\n$ sudo -g dialer /usr/bin/cu\n\nMultiple users and groups may be present in a RunasSpec, in which case the user  may  select\nany combination of users and groups via the -u and -g options.  In this example:\n\nalan    ALL = (root, bin : operator, system) ALL\n\nuser alan may run any command as either user root or bin, optionally setting the group to op‐\nerator or system.\n"
                },
                {
                    "name": "Option_Spec",
                    "content": "A  Cmnd  may  have  zero  or more options associated with it.  Options may consist of SELinux\nroles and/or types, AppArmor profiles, start and/or end dates and command timeouts.  Once  an\noption  is set for a Cmnd, subsequent Cmnds in the CmndSpecList, inherit that option unless\nit is overridden by another option.  Option names are reserved words in sudoers.  This  means\nthat none of the valid option names (see below) can be used when declaring an alias.\n"
                },
                {
                    "name": "SELinux_Spec",
                    "content": "On  systems  with  SELinux  support, sudoers file entries may optionally have an SELinux role\nand/or type associated with a command.  This can be used to implement a  form  of  role-based\naccess  control (RBAC).  If a role or type is specified with the command it will override any\ndefault values specified in sudoers.  A role or type specified on the command line,  however,\nwill supersede the values in sudoers.\n"
                },
                {
                    "name": "AppArmor_Spec",
                    "content": "On  systems supporting AppArmor, sudoers file entries may optionally specify an AppArmor pro‐\nfile that should be used to confine a command.  If an AppArmor profile is specified with  the\ncommand, it will override any default values specified in sudoers.  Appropriate profile tran‐\nsition rules must be defined to support the profile change specified for a user.\n\nAppArmor   profiles   can   be  specified  in  any  way  that  complies  with  the  rules  of\naachangeprofile(2).  For instance, in the following sudoers entry\n\nalice   ALL = (root)    APPARMORPROFILE=my-profile     ALL\n\nthe user alice may run any command as root under confinement  by  the  profile  ‘my-profile’.\nYou  can also stack profiles, or allow a user to run commands unconfined by any profile.  For\nexample:\n\nbob     ALL = (root)    APPARMORPROFILE=foo//&bar      /usr/bin/vi\ncathy   ALL = (root)    APPARMORPROFILE=unconfined     /bin/ls\n\nThese sudoers entries allow user bob to run /usr/bin/vi as root under  the  stacked  profiles\n‘foo’ and ‘bar’, and user cathy to run /bin/ls without any confinement at all.\n"
                },
                {
                    "name": "Date_Spec",
                    "content": "sudoers  rules can be specified with a start and end date via the NOTBEFORE and NOTAFTER set‐\ntings.  The time stamp must be specified in “Generalized Time” as defined by RFC  4517.   The\nformat  is effectively ‘yyyymmddHHMMSSZ’ where the minutes and seconds are optional.  The ‘Z’\nsuffix indicates that the time stamp is in Coordinated Universal Time (UTC).  It is also pos‐\nsible to specify a timezone offset from UTC in hours and minutes instead of a ‘Z’.  For exam‐\nple, ‘-0500’ would correspond to Eastern Standard time in the US.  As an extension, if no ‘Z’\nor timezone offset is specified, local time will be used.\n\nThe following are all valid time stamps:\n\n20170214083000Z\n2017021408Z\n20160315220000-0500\n20151201235900\n"
                },
                {
                    "name": "Timeout_Spec",
                    "content": "A command may have a timeout associated with it.  If the timeout expires before  the  command\nhas  exited, the command will be terminated.  The timeout may be specified in combinations of\ndays, hours, minutes, and seconds with a single-letter case-insensitive suffix that indicates\nthe unit of time.  For example, a timeout of 7 days, 8 hours,  30  minutes,  and  10  seconds\nwould  be  written as ‘7d8h30m10s’.  If a number is specified without a unit, seconds are as‐\nsumed.  Any of the days, minutes, hours, or seconds may be omitted.  The order must  be  from\nlargest to smallest unit and a unit may not be specified more than once.\n\nThe  following  are  all  valid timeout values: ‘7d8h30m10s’, ‘14d’, ‘8h30m’, ‘600s’, ‘3600’.\nThe following are invalid timeout values: ‘12m2w1d’, ‘30s10m4h’, ‘1d2d3h’.\n\nThis setting is only supported by version 1.8.20 or higher.\n"
                },
                {
                    "name": "Chdir_Spec",
                    "content": "The working directory that the command will be run in can be specified using the CWD setting.\nThe directory must be a fully-qualified path name beginning with a ‘/’ or ‘~’  character,  or\nthe special value “*”.  A value of “*” indicates that the user may specify the working direc‐\ntory  by  running  sudo  with  the -D option.  By default, commands are run from the invoking\nuser's current working directory, unless the -i option is given.   Path  names  of  the  form\n~user/path/name are interpreted as being relative to the named user's home directory.  If the\nuser name is omitted, the path will be relative to the runas user's home directory.\n\nThis setting is only supported by version 1.9.3 or higher.\n"
                },
                {
                    "name": "Chroot_Spec",
                    "content": "The root directory that the command will be run in can be specified using the CHROOT setting.\nThe  directory  must be a fully-qualified path name beginning with a ‘/’ or ‘~’ character, or\nthe special value “*”.  A value of “*” indicates that the user may specify the root directory\nby running sudo with the -R option.  This setting can  be  used  to  run  the  command  in  a\nchroot(2) “sandbox” similar to the chroot(8) utility.  Path names of the form ~user/path/name\nare  interpreted  as  being relative to the named user's home directory.  If the user name is\nomitted, the path will be relative to the runas user's home directory.\n\nThis setting is only supported by version 1.9.3 or higher.\n"
                },
                {
                    "name": "Tag_Spec",
                    "content": "A command may have zero or more tags associated with it.  The following tag values  are  sup‐\nported:  EXEC,  NOEXEC,  FOLLOW,  NOFOLLOW, LOGINPUT, NOLOGINPUT, LOGOUTPUT, NOLOGOUTPUT,\nMAIL, NOMAIL, INTERCEPT, NOINTERCEPT, PASSWD, NOPASSWD, SETENV, and NOSETENV.  Once a tag  is\nset  on a Cmnd, subsequent Cmnds in the CmndSpecList, inherit the tag unless it is overrid‐\nden by the opposite tag (in other words,  PASSWD  overrides  NOPASSWD  and  NOEXEC  overrides\nEXEC).\n\nEXEC and NOEXEC\n\nIf  sudo has been compiled with noexec support and the underlying operating system supports\nit, the NOEXEC tag can be used to prevent a dynamically-linked executable from running fur‐\nther commands itself.\n\nIn the following example, user aaron may run /usr/bin/more  and  /usr/bin/vi  on  the  host\nshanty, but shell escapes will be disabled.\n\naaron   shanty = NOEXEC: /usr/bin/more, /usr/bin/vi\n\nSee  the  “Preventing shell escapes” section below for more details on how NOEXEC works and\nwhether or not it will work on your system.\n\nFOLLOW and NOFOLLOW\n\nStarting with version 1.8.15, sudoedit will not open a file that is a symbolic link  unless\nthe  sudoeditfollow  flag  is enabled.  The FOLLOW and NOFOLLOW tags override the value of\nsudoeditfollow and can be used to permit (or deny) the editing of symbolic links on a per-\ncommand basis.  These tags are only effective for the sudoedit command and are ignored  for\nall other commands.\n\nLOGINPUT and NOLOGINPUT\n\nThese  tags  override the value of the loginput flag on a per-command basis.  For more in‐\nformation, see “I/O LOGGING”.\n\nLOGOUTPUT and NOLOGOUTPUT\n\nThese tags override the value of the logoutput flag on a per-command basis.  For more  in‐\nformation, see “I/O LOGGING”.\n\nMAIL and NOMAIL\n\nThese  tags  provide fine-grained control over whether mail will be sent when a user runs a\ncommand by overriding the value of the mailallcmnds flag on a  per-command  basis.   They\nhave no effect when sudo is run with the -l or -v options.  A NOMAIL tag will also override\nthe  mailalways  and mailnoperms options.  For more information, see the descriptions of\nmailallcmnds, mailalways, and mailnoperms in the “SUDOERS OPTIONS” section below.\n\nPASSWD and NOPASSWD\n\nBy default, sudo requires that a user authenticate before running a command.  This behavior\ncan be modified via the NOPASSWD tag.  Like a RunasSpec, the NOPASSWD tag sets  a  default\nfor  the  commands that follow it in the CmndSpecList.  Conversely, the PASSWD tag can be\nused to reverse things.  For example:\n\nray     rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm\n\nwould allow the user ray to run /bin/kill, /bin/ls, and /usr/bin/lprm as root  on  the  ma‐\nchine  “rushmore”  without  authenticating  himself.  If we only want ray to be able to run\n/bin/kill without a password the entry would be:\n\nray     rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm\n\nNote, however, that the PASSWD tag has no effect on users who are in the group specified by\nthe exemptgroup setting.\n\nBy default, if the NOPASSWD tag is applied to any of a user's entries for the current host,\nthe user will be able to run ‘sudo -l’ without a password.  Additionally, a user  may  only\nrun ‘sudo -v’ without a password if all of the user's entries for the current host have the\nNOPASSWD tag.  This behavior may be overridden via the verifypw and listpw options.\n\nSETENV and NOSETENV\n\nThese  tags  override  the  value of the setenv flag on a per-command basis.  If SETENV has\nbeen set for a command, the user may disable the envreset flag from the command  line  via\nthe -E option.  Additionally, environment variables set on the command line are not subject\nto  the  restrictions imposed by envcheck, envdelete, or envkeep.  As such, only trusted\nusers should be allowed to set variables in this manner.  If the command  matched  is  ALL,\nthe  SETENV  tag  is implied for that command; this default may be overridden by use of the\nNOSETENV tag.\n\nINTERCEPT and NOINTERCEPT\n\nIf sudo has been compiled with intercept support and the underlying operating  system  sup‐\nports  it, the INTERCEPT tag can be used to cause programs spawned by a command to be vali‐\ndated against sudoers and logged just like they would be  if  run  through  sudo  directly.\nThis  is  useful  in  conjunction  with  commands that allow shell escapes such as editors,\nshells, and paginators.  There is additional overhead due to the policy check that may  add\nlatency when running commands such as shell scripts that execute a large number of sub-com‐\nmands.   For  interactive  commands, such as a shell or editor, the overhead is not usually\nnoticeable.\n\nIn the following example, user chuck may run any command on the machine “research”  in  in‐\ntercept mode.\n\nchuck   research = INTERCEPT: ALL\n\nSee  the  “Preventing  shell escapes” section below for more details on how INTERCEPT works\nand whether or not it will work on your system.\n"
                },
                {
                    "name": "Wildcards",
                    "content": "sudo allows shell-style wildcards (aka meta or glob characters) to be  used  in  host  names,\npath  names,  and  command line arguments in the sudoers file.  Wildcard matching is done via\nthe glob(3) and fnmatch(3) functions as specified by IEEE Std 1003.1 (“POSIX.1”).\n\n*       Matches any set of zero or more characters (including white space).\n\n?       Matches any single character (including white space).\n\n[...]   Matches any character in the specified range.\n\n[!...]  Matches any character not in the specified range.\n\n\\x      For any character ‘x’, evaluates to ‘x’.  This is used to escape  special  characters\nsuch as: ‘*’, ‘?’, ‘[’, and ‘]’.\n\nThese  are not regular expressions.  Unlike a regular expression there is no way to match one\nor more characters within a range.\n\nCharacter classes may be used if your system's glob(3) and fnmatch(3) functions support them.\nHowever, because the ‘:’ character has special meaning in sudoers, it must be  escaped.   For\nexample:\n\n/bin/ls [[\\:alpha\\:]]*\n\nWould match any file name beginning with a letter.\n\nA  forward  slash (‘/’) will not be matched by wildcards used in the file name portion of the\ncommand.  This is to make a path like:\n\n/usr/bin/*\n\nmatch /usr/bin/who but not /usr/bin/X11/xterm.\n\nWhen matching the command line arguments, however, a slash  does  get  matched  by  wildcards\nsince command line arguments may contain arbitrary strings and not just path names.\n"
                },
                {
                    "name": "Wildcards in command line arguments should be used with care.",
                    "content": "Wildcards  can match any character, including white space.  In most cases, it is safer to use\na regular expression to match command line arguments.  For more information,  see  “Wildcards\nin command arguments” below.\n"
                },
                {
                    "name": "Exceptions to wildcard rules",
                    "content": "The following exceptions apply to the above rules:\n\n\"\"        If  the empty string ‘\"\"’ is the only command line argument in the sudoers file en‐\ntry it means that command is not allowed to be run with any arguments.\n\nsudoedit  Command line arguments to the sudoedit  built-in  command  should  always  be  path\nnames, so a forward slash (‘/’) will not be matched by a wildcard.\n"
                },
                {
                    "name": "Regular expressions",
                    "content": "Starting  with  version  1.9.10, it is possible to use regular expressions for path names and\ncommand line arguments.  Regular expressions are more expressive than  shell-style  wildcards\nand  are  usually  safer because they provide a greater degree of control when matching.  The\ntype of regular expressions supported by sudoers are POSIX extended regular expressions, sim‐\nilar to those used by the egrep(1) utility.  They are usually documented in the  regex(7)  or\nreformat(7) manual, depending on the system.  As an extension, if the regular expression be‐\ngins with “(?i)”, it will be matched in a case-insensitive manner.\n\nIn  sudoers,  regular  expressions  must start with a ‘^’ character and end with a ‘$’.  This\nmakes it explicit what is, or is not, a regular expression.  Either the path name,  the  com‐\nmand  line arguments or both may be regular expressions.  Because the path name and arguments\nare matched separately, it is even possible to use wildcards for the path  name  and  regular\nexpressions  for  the  arguments.   It  is not possible to use a single regular expression to\nmatch both the command and its arguments.  Regular expressions in sudoers are limited to 1024\ncharacters.\n\nThere is no need to escape sudoers special characters in a regular expression other than  the\npound sign (‘#’).\n\nIn  the following example, user john can run the passwd(1) command as root on any host but is\nnot allowed to change root's password.  This kind of rule is impossible to express safely us‐\ning wildcards.\n\njohn    ALL = /usr/bin/passwd ^[a-zA-Z0-9]+$,\\\n!/usr/bin/passwd root\n\nIt is also possible to use a regular expression in conjunction with sudoedit rules.  The fol‐\nlowing rule would give user bob the ability to edit the /etc/motd, /etc/issue, and /etc/hosts\nfiles only.\n\nbob    ALL = sudoedit ^/etc/(motd|issue|hosts)$\n\nRegular expressions may also be used to match the command itself.  In this example, a regular\nexpression is used to allow user  sid  to  run  the  /usr/sbin/groupadd,  /usr/sbin/groupmod,\n/usr/sbin/groupdel,  /usr/sbin/useradd,  /usr/sbin/usermod, and /usr/sbin/userdel commands as\nroot.\n\nsid    ALL = ^/usr/sbin/(group|user)(add|mod|del)$\n\nOne disadvantage of using a regular expression to match the command name is that  it  is  not\npossible to match relative paths such as ./useradd or ../sbin/useradd.  This has security im‐\nplications  when  a  regular  expression is used for the command name in conjunction with the\nnegation operator, ‘!’, as such rules can be trivially bypassed.  Because of  this,  using  a\nnegated regular expression for the command name is strongly discouraged.  This does not apply\nto  negated  commands that only use a regular expression to match the command arguments.  See\n“Regular expressions in command names” below for more information.\n"
                },
                {
                    "name": "Including other files from within sudoers",
                    "content": "It is possible to include other sudoers files from within the sudoers  file  currently  being\nparsed  using  the @include and @includedir directives.  For compatibility with sudo versions\nprior to 1.9.1, #include and #includedir are also accepted.\n\nAn include file can be used, for example, to keep a site-wide sudoers file in addition  to  a\nlocal,  per-machine  file.   For  the sake of this example the site-wide sudoers file will be\n/etc/sudoers  and   the   per-machine   one   will   be   /etc/sudoers.local.    To   include\n/etc/sudoers.local from within /etc/sudoers one would use the following line in /etc/sudoers:\n\n@include /etc/sudoers.local\n\nWhen sudo reaches this line it will suspend processing of the current file (/etc/sudoers) and\nswitch  to  /etc/sudoers.local.   Upon  reaching  the  end of /etc/sudoers.local, the rest of\n/etc/sudoers will be processed.  Files that are included may themselves include other  files.\nA hard limit of 128 nested include files is enforced to prevent include file loops.\n\nStarting  with  version  1.9.1, the path to the include file may contain white space if it is\nescaped with a backslash (‘\\’).  Alternately, the entire  path  may  be  enclosed  in  double\nquotes  (\"\"),  in which case no escaping is necessary.  To include a literal backslash in the\npath, ‘\\\\’ should be used.\n\nIf the path to the include file is not fully-qualified (does not begin with a ‘/’),  it  must\nbe  located  in the same directory as the sudoers file it was included from.  For example, if\n/etc/sudoers contains the line:\n\n@include sudoers.local\n\nthe file that will be included is /etc/sudoers.local.\n\nThe file name may also include the ‘%h’ escape, signifying the short form of the  host  name.\nIn other words, if the machine's host name is “xerxes”, then\n\n@include /etc/sudoers.%h\n\nwill  cause sudo to include the file /etc/sudoers.xerxes.  Any path name separator characters\n(‘/’) present in the host name will be replaced with an underbar (‘’) during expansion.\n\nThe @includedir directive can be used to create a sudoers.d directory that the system package\nmanager can drop sudoers file rules into as  part  of  package  installation.   For  example,\ngiven:\n\n@includedir /etc/sudoers.d\n\nsudo  will suspend processing of the current file and read each file in /etc/sudoers.d, skip‐\nping file names that end in ‘~’ or contain a ‘.’ character to  avoid  causing  problems  with\npackage manager or editor temporary/backup files.\n\nFiles  are  parsed  in sorted lexical order.  That is, /etc/sudoers.d/01first will be parsed\nbefore /etc/sudoers.d/10second.  Be aware that because the sorting is lexical, not  numeric,\n/etc/sudoers.d/1whoops  would  be loaded after /etc/sudoers.d/10second.  Using a consistent\nnumber of leading zeroes in the file names can be used to avoid such problems.  After parsing\nthe files in the directory, control returns to the file that contained the @includedir direc‐\ntive.\n\nUnlike files included via @include, visudo will not edit the files in a @includedir directory\nunless one of them contains a syntax error.  It is still possible to run visudo with  the  -f\nflag to edit the files directly, but this will not catch the redefinition of an alias that is\nalso present in a different file.\n"
                },
                {
                    "name": "Other special characters and reserved words",
                    "content": "The pound sign (‘#’) is used to indicate a comment (unless it is part of a #include directive\nor  unless  it occurs in the context of a user name and is followed by one or more digits, in\nwhich case it is treated as a user-ID).  Both the comment character and any text after it, up\nto the end of the line, are ignored.\n\nThe reserved word ALL is a built-in alias that always causes a match to succeed.  It  can  be\nused  wherever  one might otherwise use a CmndAlias, UserAlias, RunasAlias, or HostAlias.\nAttempting to define an alias named ALL will result in a syntax error.  Using ALL can be dan‐\ngerous since in a command context, it allows the user to run any command on the system.\n\nThe following option names permitted in an OptionSpec are also  considered  reserved  words:\nCHROOT, ROLE, TYPE, TIMEOUT, CWD, NOTBEFORE and NOTAFTER.  Attempting to define an alias with\nthe same name as one of the options will result in a syntax error.\n\nAn  exclamation  point (‘!’) can be used as a logical not operator in a list or alias as well\nas in front of a Cmnd.  This allows one to exclude certain values.  For the ‘!’  operator  to\nbe effective, there must be something for it to exclude.  For example, to match all users ex‐\ncept for root one would use:\n\nALL, !root\n\nIf the ALL, is omitted, as in:\n\n!root\n\nit  would  explicitly deny root but not match any other users.  This is different from a true\n“negation” operator.\n\nNote, however, that using a ‘!’ in conjunction with the built-in ALL alias to allow a user to\nrun “all but a few” commands rarely works as intended (see “SECURITY NOTES” below).\n\nLong lines can be continued with a backslash (‘\\’) as the last character on the line.\n\nWhite space between elements in a list as well as special  syntactic  characters  in  a  User\nSpecification (‘=’, ‘:’, ‘(’, ‘)’) is optional.\n\nThe  following  characters must be escaped with a backslash (‘\\’) when used as part of a word\n(e.g., a user name or host name): ‘!’, ‘=’, ‘:’, ‘,’, ‘(’, ‘)’, ‘\\’.\n"
                }
            ]
        },
        "SUDOERS OPTIONS": {
            "content": "sudo's behavior can be modified by DefaultEntry lines, as explained earlier.  A list of  all\nsupported Defaults parameters, grouped by type, are listed below.\n\nBoolean Flags:\n\nalwaysquerygroupplugin\nIf  a  groupplugin  is  configured,  use  it to resolve groups of the form\n‘%group’ as long as there is not also a system  group  of  the  same  name.\nNormally, only groups of the form ‘%:group’ are passed to the groupplugin.\nThis flag is off by default.\n\nalwayssethome   If  enabled, sudo will set the HOME environment variable to the home direc‐\ntory of the target user (which is the runasdefault user unless the -u  op‐\ntion  is used).  This flag is largely obsolete and has no effect unless the\nenvreset flag has been disabled or HOME is present in the  envkeep  list,\nboth of which are strongly discouraged.  This flag is off by default.\n\nauthenticate      If  set,  users must authenticate themselves via a password (or other means\nof authentication) before they may run commands.  This default may be over‐\nridden via the PASSWD and NOPASSWD tags.  This flag is on by default.\n\ncaseinsensitivegroup\nIf enabled, group names in sudoers will be matched in  a  case  insensitive\nmanner.   This  may be necessary when users are stored in LDAP or AD.  This\nflag is on by default.\n\ncaseinsensitiveuser\nIf enabled, user names in sudoers will be matched  in  a  case  insensitive\nmanner.   This may be necessary when groups are stored in LDAP or AD.  This\nflag is on by default.\n\nclosefromoverride\nIf set, the user may use the -C option which overrides the default starting\npoint at which sudo begins closing open file descriptors.  This flag is off\nby default.\n\ncompressio       If set, and sudo is configured to log a command's input or output, the  I/O\nlogs  will  be compressed using zlib.  This flag is on by default when sudo\nis compiled with zlib support.\n\nexecbackground   By default, sudo runs a command as the foreground process as long  as  sudo\nitself  is running in the foreground.  When the execbackground flag is en‐\nabled and the command is being run in a pseudo-terminal (due to I/O logging\nor the usepty flag), the command will be run as a background process.  At‐\ntempts to read from the controlling terminal (or to  change  terminal  set‐\ntings)  will  result in the command being suspended with the SIGTTIN signal\n(or SIGTTOU in the case of terminal settings).  If this happens  when  sudo\nis a foreground process, the command will be granted the controlling termi‐\nnal  and resumed in the foreground with no user intervention required.  The\nadvantage of initially running the command in the background is  that  sudo\nneed  not read from the terminal unless the command explicitly requests it.\nOtherwise, any terminal input must be passed to the command, whether it has\nrequired it or not (the kernel buffers terminals so it is not  possible  to\ntell  whether  the command really wants the input).  This is different from\nhistoric sudo behavior or when the command is not being run  in  a  pseudo-\nterminal.\n\nFor  this  to  work seamlessly, the operating system must support the auto‐\nmatic restarting of system calls.  Unfortunately, not all operating systems\ndo this by default, and even those that do may have bugs.  For example, ma‐\ncOS fails to restart the tcgetattr(3) and tcsetattr(3) functions (this is a\nbug in macOS).  Furthermore, because this behavior depends on  the  command\nstopping  with  the  SIGTTIN  or SIGTTOU signals, programs that catch these\nsignals and suspend themselves with a  different  signal  (usually  SIGTOP)\nwill  not  be automatically foregrounded.  Some versions of the linux su(1)\ncommand behave this way.  This flag is off by default.\n\nThis setting is only supported by version 1.8.7 or higher.  It has  no  ef‐\nfect unless I/O logging is enabled or the usepty flag is enabled.\n\nenveditor        If  set, visudo will use the value of the SUDOEDITOR, VISUAL or EDITOR en‐\nvironment variables before falling back on the default editor list.  visudo\nis typically run as root so this flag may allow a user with  visudo  privi‐\nleges to run arbitrary commands as root without logging.  An alternative is\nto  place  a colon-separated list of “safe” editors int the editor setting.\nvisudo will then only use SUDOEDITOR, VISUAL or EDITOR  if  they  match  a\nvalue  specified  in  editor.   If  the  envreset  flag  is  enabled,  the\nSUDOEDITOR, VISUAL and/or EDITOR environment variables must be present  in\nthe  envkeep  list  for the enveditor flag to function when visudo is in‐\nvoked via sudo.  This flag is on by default.\n\nenvreset         If set, sudo will run the command in a minimal environment  containing  the\nTERM,  PATH,  HOME,  MAIL,  SHELL, LOGNAME, USER and SUDO* variables.  Any\nvariables in the caller's environment or  in  the  file  specified  by  the\nrestrictedenvfile setting that match the envkeep and envcheck lists are\nthen  added, followed by any variables present in the file specified by the\nenvfile setting (if any).  The contents  of  the  envkeep  and  envcheck\nlists,  as modified by global Defaults parameters in sudoers, are displayed\nwhen sudo is run by root with the -V option.  If the securepath setting is\nenabled, its value will be used for the PATH  environment  variable.   This\nflag is on by default.\n\nfastglob         Normally,  sudo  uses  the glob(3) function to do shell-style globbing when\nmatching path names.  However, since it accesses the file  system,  glob(3)\ncan  take  a  long  time to complete for some patterns, especially when the\npattern references a network file system that is mounted  on  demand  (auto\nmounted).   The  fastglob flag causes sudo to use the fnmatch(3) function,\nwhich does not access the file system to do its matching.  The disadvantage\nof fastglob is that it is unable to match relative paths such as  ./ls  or\n../bin/ls.   This  has  security  implications when path names that include\nglobbing characters are used with the negation operator, ‘!’, as such rules\ncan be trivially bypassed.  As such, this flag should not be used when  the\nsudoers  file  contains rules that contain negated path names which include\nglobbing characters.  This flag is off by default.\n\nlogpasswords     Most programs that require a user's password will disable echo before read‐\ning the password to avoid displaying the plaintext password on the  screen.\nHowever,  if  terminal input is being logged (see “I/O LOGGING”), the pass‐\nword will still be present in the I/O log.  If the logpasswords option  is\ndisabled,  sudoers will attempt to prevent passwords from being logged.  It\ndoes this by using the regular expressions in passpromptregex to  match  a\npassword  prompt in the terminal output buffer.  When a match is found, in‐\nput characters in the I/O log will be replaced with ‘*’ until either a line\nfeed or carriage return is found in the terminal input or  a  new  terminal\noutput  buffer  is received.  If, however, a program displays characters as\nthe user types (such as sudo when pwfeedback is set), only the first  char‐\nacter  of the password will be replaced in the I/O log.  This option has no\neffect unless loginput or logttyin are also set.  This flag is on by  de‐\nfault.\n\nThis setting is only supported by version 1.9.10 or higher.\n\nfqdn              Set  this flag if you want to put fully qualified host names in the sudoers\nfile when the local host name (as returned by the ‘hostname’ command)  does\nnot  contain  the domain name.  In other words, instead of myhost you would\nuse myhost.mydomain.edu.  You may still use the short form if you wish (and\neven mix the two).  This flag is only effective when the  “canonical”  host\nname,  as returned by the getaddrinfo(3) or gethostbyname(3) function, is a\nfully-qualified domain name.  This is usually the case when the  system  is\nconfigured to use DNS for host name resolution.\n\nIf  the  system  is  configured to use the /etc/hosts file in preference to\nDNS, the “canonical” host name may not be fully-qualified.  The order  that\nsources  are  queried  for host name resolution is usually specified in the\n/etc/nsswitch.conf, /etc/netsvc.conf, /etc/host.conf, or,  in  some  cases,\n/etc/resolv.conf  file.  In the /etc/hosts file, the first host name of the\nentry is considered to  be  the  “canonical”  name;  subsequent  names  are\naliases  that  are  not  used by sudoers.  For example, the following hosts\nfile line for the machine “xyzzy” has the fully-qualified  domain  name  as\nthe “canonical” host name, and the short version as an alias.\n\n192.168.1.1 xyzzy.sudo.ws xyzzy\n\nIf  the machine's hosts file entry is not formatted properly, the fqdn flag\nwill not be effective if it is queried before DNS.\n\nBeware that when using DNS for host name resolution, turning  on  fqdn  re‐\nquires sudoers to make DNS lookups which renders sudo unusable if DNS stops\nworking  (for  example  if  the  machine is disconnected from the network).\nJust like with the hosts file, you must use the  “canonical”  name  as  DNS\nknows  it.  That is, you may not use a host alias (CNAME entry) due to per‐\nformance issues and the fact that there is no way to get all  aliases  from\nDNS.\n\nThis flag is on by default.\n\nignoreauditerrors\nAllow commands to be run even if sudoers cannot write to the audit log.  If\nenabled,  an  audit  log write failure is not treated as a fatal error.  If\ndisabled, a command may only be run after the audit event  is  successfully\nwritten.  This flag is only effective on systems for which sudoers supports\naudit  logging, including FreeBSD, Linux, macOS, and Solaris.  This flag is\non by default.\n\nignoredot        If set, sudo will ignore \".\" or \"\" (both denoting the current directory) in\nthe PATH environment variable; the PATH itself is not modified.  This  flag\nis off by default.\n\nignoreiologerrors\nAllow commands to be run even if sudoers cannot write to the I/O log (local\nor remote).  If enabled, an I/O log write failure is not treated as a fatal\nerror.   If  disabled, the command will be terminated if the I/O log cannot\nbe written to.  This flag is off by default.\n\nignorelogfileerrors\nAllow commands to be run even if sudoers cannot write to the log file.   If\nenabled, a log file write failure is not treated as a fatal error.  If dis‐\nabled,  a  command may only be run after the log file entry is successfully\nwritten.  This flag only has an effect when sudoers is  configured  to  use\nfile-based logging via the logfile setting.  This flag is on by default.\n\nignorelocalsudoers\nIf set via LDAP, parsing of /etc/sudoers will be skipped.  This is intended\nfor  sites  that  wish  to prevent the usage of local sudoers files so that\nonly LDAP is used.  This thwarts the efforts of rogue operators  who  would\nattempt  to  add  roles  to  /etc/sudoers.   When  this  flag  is  enabled,\n/etc/sudoers does not even need to exist.  Since this flag tells  sudo  how\nto  behave when no specific LDAP entries have been matched, this sudoOption\nis only meaningful for the ‘cn=defaults’ section.  This flag is off by  de‐\nfault.\n\nignoreunknowndefaults\nIf  set,  sudo  will  not produce a warning if it encounters an unknown De‐\nfaults entry in the sudoers file or an unknown sudoOption  in  LDAP.   This\nflag is off by default.\n\ninsults           If set, sudo will insult users when they enter an incorrect password.  This\nflag is off by default.\n\nlogallowed       If set, sudoers will log commands allowed by the policy to the system audit\nlog (where supported) as well as to syslog and/or a log file.  This flag is\non by default.\n\nThis setting is only supported by version 1.8.29 or higher.\n\nlogdenied        If  set, sudoers will log commands denied by the policy to the system audit\nlog (where supported) as well as to syslog and/or a log file.  This flag is\non by default.\n\nThis setting is only supported by version 1.8.29 or higher.\n\nlogexitstatus   If set, sudoers will log the exit value of commands that are run to  syslog\nand/or  a  log  file.   If a command was terminated by a signal, the signal\nname is logged as well.  This flag is off by default.\n\nThis setting is only supported by version 1.9.8 or higher.\n\nloghost          If set, the host name will be included in log entries written to  the  file\nconfigured by the logfile setting.  This flag is off by default.\n\nloginput         If  set,  sudo  will  run the command in a pseudo-terminal (if sudo was run\nfrom a terminal) and log all user input.  If the standard input is not con‐\nnected to the user's terminal, due to I/O redirection or because  the  com‐\nmand  is  part of a pipeline, that input is also logged.  For more informa‐\ntion about I/O logging, see the “I/O LOGGING” section.  This flag is off by\ndefault.\n\nlogoutput        If set, sudo will run the command in a pseudo-terminal  (if  sudo  was  run\nfrom  a  terminal)  and log all output that is sent to the user's terminal,\nthe standard output or the standard error.  If the standard output or stan‐\ndard error is not connected to the user's terminal, due to I/O  redirection\nor  because  the command is part of a pipeline, that output is also logged.\nFor more information about I/O logging,  see  the  “I/O  LOGGING”  section.\nThis flag is off by default.\n\nlogserverkeepalive\nIf  set, sudo will enable the TCP keepalive socket option on the connection\nto the log server.  This enables the  periodic  transmission  of  keepalive\nmessages  to  the server.  If the server does not respond to a message, the\nconnection will be closed and the running command will be terminated unless\nthe ignoreiologerrors flag (I/O logging enabled) or the ignorelogerrors\nflag (I/O logging disabled) is set.  This flag is on by default.\n\nThis setting is only supported by version 1.9.0 or higher.\n\nlogserververify\nIf set, the server certificate received during the TLS  handshake  must  be\nvalid  and it must contain either the server name (from logservers) or its\nIP address.  If either of these conditions is not met,  the  TLS  handshake\nwill fail.  This flag is on by default.\n\nThis setting is only supported by version 1.9.0 or higher.\n\nlogstderr        If  set,  sudo  will  log  the standard error if it is not connected to the\nuser's terminal.  This can be used to log output to a pipe or redirected to\na file.  This flag is off  by  default  but  is  enabled  when  either  the\nlogoutput flag or the LOGOUTPUT command tag is set.\n\nlogstdin         If  set,  sudo  will  log  the standard input if it is not connected to the\nuser's terminal.  This can be used to log input from a pipe  or  redirected\nfrom  a  file.   This flag is off by default but is enabled when either the\nloginput flag or the LOGINPUT command tag is set.\n\nlogstdout        If set, sudo will log the standard output if it is  not  connected  to  the\nuser's terminal.  This can be used to log output to a pipe or redirected to\na  file.   This  flag  is  off  by  default  but is enabled when either the\nlogoutput flag or the LOGOUTPUT command tag is set.\n\nlogsubcmds       If set, sudoers will log when a command spawns a child process and executes\na program using the execve(2), execl(3),  execle(3),  execlp(3),  execv(3),\nexecvp(3),  execvpe(3),  or system(3) library functions.  For example, if a\nshell is run by sudo, the individual commands run via  the  shell  will  be\nlogged.  This flag is off by default.\n\nThe  logsubcmds  flag  uses the same underlying mechanism as the intercept\nsetting.  Some commands may not work properly when logsubcmds is  enabled,\ndue  to the way it intercepts sub-commands.  See “Preventing shell escapes”\nfor more information on what systems support this option  and  its  limita‐\ntions.   This  setting  is only supported by version 1.9.8 or higher and is\nincompatible  with  SELinux  RBAC  support  unless  the   system   supports\nseccomp(2) filter mode.\n\nlogttyin         If  set,  sudo  will run the command in a pseudo-terminal and log user key‐\nstrokes sent to the user's terminal, if one is present.  This flag  is  off\nby  default  but is enabled when either the loginput flag or the LOGINPUT\ncommand tag is set.  If no terminal is present, for example when running  a\nremote command using ssh(1), this flag will have no effect.\n\nlogttyout        If  set,  sudo will run the command in a pseudo-terminal and log all output\ndisplayed on the user's terminal, if one is present.  This flag is  off  by\ndefault  but  is  enabled when either the logoutput flag or the LOGOUTPUT\ncommand tag is set.  If no terminal is present, for example when running  a\nremote command using ssh(1), this flag will have no effect.\n\nlogyear          If  set,  the  four-digit  year will be logged in the (non-syslog) sudo log\nfile.  This flag is off by default.\n\nlongotpprompt   When validating with a One Time Password (OTP)  scheme  such  as  S/Key  or\nOPIE,  a  two-line  prompt  is  used to make it easier to cut and paste the\nchallenge to a local window.  It's not as pretty as the  default  but  some\npeople find it more convenient.  This flag is off by default.\n\nmailallcmnds    Send  mail  to  the mailto user every time a user attempts to run a command\nvia sudo (this includes sudoedit).  No mail will be sent if the  user  runs\nsudo  with  the -l or -v option unless there is an authentication error and\nthe mailbadpass flag is also set.  This flag is off by default.\n\nmailalways       Send mail to the mailto user every time a user runs sudo.  This flag is off\nby default.\n\nmailbadpass      Send mail to the mailto user if the user running sudo does  not  enter  the\ncorrect password.  If the command the user is attempting to run is not per‐\nmitted by sudoers and one of the mailallcmnds, mailalways, mailnohost,\nmailnoperms or mailnouser flags are set, this flag will have no effect.\nThis flag is off by default.\n\nmailnohost      If set, mail will be sent to the mailto user if the invoking user exists in\nthe  sudoers  file, but is not allowed to run commands on the current host.\nThis flag is off by default.\n\nmailnoperms     If set, mail will be sent to the mailto user if the invoking  user  is  al‐\nlowed  to  use  sudo but the command they are trying is not listed in their\nsudoers file entry or is explicitly denied.  This flag is off by default.\n\nmailnouser      If set, mail will be sent to the mailto user if the invoking user is not in\nthe sudoers file.  This flag is on by default.\n\nmatchgroupbygid\nBy default, sudoers will look up each group the user  is  a  member  of  by\ngroup-ID to determine the group name (this is only done once).  The result‐\ning  list  of the user's group names is used when matching groups listed in\nthe sudoers file.  This works well on systems where the  number  of  groups\nlisted  in  the  sudoers file is larger than the number of groups a typical\nuser belongs to.  On systems where group lookups are slow, where users  may\nbelong to a large number of groups, or where the number of groups listed in\nthe sudoers file is relatively small, it may be prohibitively expensive and\nrunning  commands via sudo may take longer than normal.  On such systems it\nmay be faster to use the matchgroupbygid flag  to  avoid  resolving  the\nuser's  group-IDs  to  group names.  In this case, sudoers must look up any\ngroup name listed in the sudoers file and use the group-ID instead  of  the\ngroup name when determining whether the user is a member of the group.\n\nIf  matchgroupbygid  is  enabled,  group  database  lookups performed by\nsudoers will be keyed by group name as opposed  to  group-ID.   On  systems\nwhere  there are multiple sources for the group database, it is possible to\nhave conflicting group names or group-IDs in the local /etc/group file  and\nthe  remote  group  database.   On  such  systems,  enabling  or  disabling\nmatchgroupbygid can be used to choose whether group database queries are\nperformed by name (enabled) or ID (disabled),  which  may  aid  in  working\naround group entry conflicts.\n\nThe  matchgroupbygid  flag  has no effect when sudoers data is stored in\nLDAP.  This flag is off by default.\n\nThis setting is only supported by version 1.8.18 or higher.\n\nintercept         If set, all commands run via sudo will behave as if the INTERCEPT  tag  has\nbeen  set,  unless overridden by an NOINTERCEPT tag.  Some commands may not\nwork properly when intercept is enabled, due to the way it  intercept  sub-\ncommands.   See  the description of INTERCEPT and NOINTERCEPT above as well\nas the “Preventing shell escapes” section at the end of this manual.   This\nflag is off by default.\n\nThis setting is only supported by version 1.9.8 or higher and is incompati‐\nble  with SELinux RBAC support unless the system supports seccomp(2) filter\nmode.\n\ninterceptallowsetid\nOn most systems, the dynamic loader will ignore LDPRELOAD (or the  equiva‐\nlent)  when running set-user-ID and set-group-ID programs, effectively dis‐\nabling intercept mode.  To prevent this from happening,  sudoers  will  not\npermit  a  set-user-ID  or set-group-ID program to be run in intercept mode\nunless interceptallowsetid is enable.  This flag has no effect unless the\nintercept flag is enabled or the INTERCEPT tag has been set  for  the  com‐\nmand.   This flag is on by default when the intercepttype option is set to\ntrace, otherwise it default to off.\n\nThis setting is only supported by version 1.9.8 or higher.\n\ninterceptauthenticate\nIf set, commands run by an intercepted process must be  authenticated  when\nthe  user's time stamp is not current.  For example, if a shell is run with\nintercept enabled, as soon as the invoking user's  time  stamp  is  out  of\ndate,  subsequent commands will need to be authenticated.  This flag has no\neffect unless the intercept flag is enabled or the INTERCEPT tag  has  been\nset for the command.  This flag is off by default.\n\nThis setting is only supported by version 1.9.8 or higher.\n\ninterceptverify  If  set,  sudo  will attempt to verify that a command run in intercept mode\nhas the expected path name, command line arguments and environment.\n\nThe process will be stopped after execve(2) has completed  but  before  the\nnew command has had a chance to run.  To verify the command, sudo will read\nthe command's path from /proc/PID/exe, the command line arguments and envi‐\nronment  from  the process's memory, and compare them against the arguments\nthat were passed to execve(2).  In the event of  a  mismatch,  the  command\nwill be sent a SIGKILL signal and terminated.\n\nThis  can help prevent a time of check versus time of use issue with inter‐\ncept mode where the execve(2) arguments could be altered after the  sudoers\npolicy  check.  The checks can only be performed if the proc(5) file system\nis available.  This flag has no effect unless the intercept flag is enabled\nor the INTERCEPT tag has been set for the command  and  the  intercepttype\noption is set to trace.\n\nThis setting is incompatible with programs that change their root directory\nvia chroot(2).  If a program changes its root directory, path names will no\nlonger match those seen by the sudo parent process and sub-commands will be\nterminated before they have a chance to run.  This flag is on by default.\n\nThis setting is only supported by version 1.9.12 or higher.\n\nnetgrouptuple    If  set,  netgroup lookups will be performed using the full netgroup tuple:\nhost name, user name, and domain (if one is set).  Historically, sudo  only\nmatched the user name and domain for netgroups used in a UserList and only\nmatched  the  host name and domain for netgroups used in a HostList.  This\nflag is off by default.\n\nnoexec            If set, all commands run via sudo will behave as if the NOEXEC tag has been\nset, unless overridden by an EXEC tag.  See the  description  of  EXEC  and\nNOEXEC  above  as well as the “Preventing shell escapes” section at the end\nof this manual.  This flag is off by default.\n\nnoninteractiveauth\nIf set, authentication will be attempted even in non-interactive mode (when\nsudo's -n option is specified).  This allows  authentication  methods  that\ndon't require user interaction to succeed.  Authentication methods that re‐\nquire input from the user's terminal will still fail.  If disabled, authen‐\ntication  will  not be attempted in non-interactive mode.  This flag is off\nby default.\n\nThis setting is only supported by version 1.9.10 or higher.\n\npamacctmgmt     On systems that use PAM for authentication, sudo will perform  PAM  account\nvalidation  for  the invoking user by default.  The actual checks performed\ndepend on which PAM modules are configured.  If enabled, account validation\nwill be performed regardless of whether or  not  a  password  is  required.\nThis flag is on by default.\n\nThis setting is only supported by version 1.8.28 or higher.\n\npamrhost         On  systems  that  use PAM for authentication, sudo will set the PAM remote\nhost value to the name of the local host when the  pamrhost  flag  is  en‐\nabled.   On  Linux systems, enabling pamrhost may result in DNS lookups of\nthe local host name when PAM is initialized.  On Solaris versions prior  to\nSolaris  8, pamrhost must be enabled if pamruser is also enabled to avoid\na crash in the Solaris PAM implementation.\n\nThis flag is off by default on systems other than Solaris.\n\nThis setting is only supported by version 1.9.0 or higher.\n\npamruser         On systems that use PAM for authentication, sudo will set  the  PAM  remote\nuser  value  to  the  name of the user that invoked sudo when the pamruser\nflag is enabled.  This flag is on by default.\n\nThis setting is only supported by version 1.9.0 or higher.\n\npamsession       On systems that use PAM for authentication, sudo will create a new PAM ses‐\nsion for the command to be run in.  Unless sudo is given the -i or  -s  op‐\ntions,  PAM  session  modules are run with the “silent” flag enabled.  This\nprevents last login information from being displayed for every  command  on\nsome systems.  Disabling pamsession may be needed on older PAM implementa‐\ntions  or on operating systems where opening a PAM session changes the utmp\nor wtmp files.  If PAM session support is disabled, resource limits may not\nbe updated for the command being run.   If  pamsession,  pamsetcred,  and\nusepty  are disabled, logservers has not been set and I/O logging has not\nbeen configured, sudo will execute the command directly instead of  running\nit as a child process.  This flag is on by default.\n\nThis setting is only supported by version 1.8.7 or higher.\n\npamsetcred       On  systems that use PAM for authentication, sudo will attempt to establish\ncredentials for the target user by default, if supported by the  underlying\nauthentication  system.   One example of a credential is a Kerberos ticket.\nIf pamsession, pamsetcred, and usepty are disabled, logservers has  not\nbeen  set  and  I/O  logging has not been configured, sudo will execute the\ncommand directly instead of running it as a child process.  This flag is on\nby default.\n\nThis setting is only supported by version 1.8.8 or higher.\n\npasspromptoverride\nIf set, the prompt specified by passprompt or the  SUDOPROMPT  environment\nvariable  will always be used and will replace the prompt provided by a PAM\nmodule or other authentication method.  This flag is off by default.\n\npathinfo         Normally, sudo will tell the user when a command  could  not  be  found  in\ntheir PATH environment variable.  Some sites may wish to disable this as it\ncould be used to gather information on the location of executables that the\nnormal  user does not have access to.  The disadvantage is that if the exe‐\ncutable is simply not in the user's PATH, sudo will tell the user that they\nare not allowed to run it, which can be confusing.  This flag is on by  de‐\nfault.\n\npreservegroups   By default, sudo will initialize the group vector to the list of groups the\ntarget  user is in.  When preservegroups is set, the user's existing group\nvector is left unaltered.  The real and effective group-IDs,  however,  are\nstill set to match the target user.  This flag is off by default.\n\npwfeedback        By default, sudo reads the password like most other Unix programs, by turn‐\ning off echo until the user hits the return (or enter) key.  Some users be‐\ncome  confused  by  this  as  it appears to them that sudo has hung at this\npoint.  When pwfeedback is set, sudo will provide visual feedback when  the\nuser presses a key.  This does have a security impact as an onlooker may be\nable  to  determine the length of the password being entered.  This flag is\noff by default.\n\nrequiretty        If set, sudo will only run when the user is logged in to a real tty.   When\nthis  flag  is  set,  sudo can only be run from a login session and not via\nother means such as cron(8) or cgi-bin scripts.  This flag is  off  by  de‐\nfault.\n\nrootsudo         If  set,  root  is  allowed to run sudo too.  Disabling this prevents users\nfrom “chaining” sudo commands to get a root shell by doing  something  like\n‘sudo  sudo  /bin/sh’.  Note, however, that turning off rootsudo will also\nprevent root from running sudoedit.  Disabling rootsudo provides  no  real\nadditional security; it exists purely for historical reasons.  This flag is\non by default.\n\nrootpw            If  set,  sudo will prompt for the root password instead of the password of\nthe invoking user when running a command or editing a file.  This  flag  is\noff by default.\n\nrunasallowunknownid\nIf enabled, allow matching of runas user and group IDs that are not present\nin the password or group databases.  In addition to explicitly matching un‐\nknown  user  or  group IDs in a RunasList, this option also allows the ALL\nalias to match unknown IDs.  This flag is off by default.\n\nThis setting is only supported by version 1.8.30 or higher.  Older versions\nof sudo always allowed matching of unknown user and group IDs.\n\nrunascheckshell\nIf enabled, sudo will only run commands as a user whose  shell  appears  in\nthe  /etc/shells  file, even if the invoking user's RunasList would other‐\nwise permit it.  If no /etc/shells file is present, a system-dependent list\nof built-in default shells is used.   On  many  operating  systems,  system\nusers such as “bin”, do not have a valid shell and this flag can be used to\nprevent  commands  from  being run as those users.  This flag is off by de‐\nfault.\n\nThis setting is only supported by version 1.8.30 or higher.\n\nrunaspw           If set, sudo will prompt for the  password  of  the  user  defined  by  the\nrunasdefault  option (defaults to root) instead of the password of the in‐\nvoking user when running a command or editing a file.  This flag is off  by\ndefault.\n\nselinux           If  enabled,  the  user may specify an SELinux role and/or type to use when\nrunning the command, as permitted by the SELinux  policy.   If  SELinux  is\ndisabled  on  the  system, this flag has no effect.  This flag is on by de‐\nfault.\n\nsethome          If enabled and sudo is invoked with the -s  option,  the  HOME  environment\nvariable will be set to the home directory of the target user (which is the\nrunasdefault user unless the -u option is used).  This flag is largely ob‐\nsolete  and  has  no  effect unless the envreset flag has been disabled or\nHOME is present in the envkeep list, both of which are  strongly  discour‐\naged.  This flag is off by default.\n\nsetlogname       Normally,  sudo  will set the LOGNAME and USER environment variables to the\nname of the target user (the user specified by runasdefault unless the  -u\noption is given).  However, since some programs (including the RCS revision\ncontrol  system) use LOGNAME to determine the real identity of the user, it\nmay be desirable to change this behavior.  This can be done by negating the\nsetlogname option.  The setlogname option will  have  no  effect  if  the\nenvreset  option  has  not  been  disabled  and the envkeep list contains\nLOGNAME or USER.  This flag is on by default.\n\nsetutmp          When enabled, sudo will create an entry in the utmp (or utmpx) file when  a\npseudo-terminal  is allocated.  A pseudo-terminal is allocated by sudo when\nit is running in a terminal and one or more of the  loginput,  logoutput,\nlogstdin,  logstdout, logstderr, logttyin, logttyout, or usepty flags\nis enabled.  By default, the new entry will be a copy of the user's  exist‐\ning  utmp entry (if any), with the tty, time, type, and pid fields updated.\nThis flag is on by default.\n\nsetenv            Allow the user to disable the envreset option from the  command  line  via\nthe  -E  option.   Additionally,  environment variables set via the command\nline are not subject to the restrictions imposed by envcheck,  envdelete,\nor  envkeep.   As  such, only trusted users should be allowed to set vari‐\nables in this manner.  This flag is off by default.\n\nshellnoargs      If set and sudo is invoked with no arguments it acts as if  the  -s  option\nhad  been given.  That is, it runs a shell as root (the shell is determined\nby the SHELL environment variable if it is set, falling back on  the  shell\nlisted  in the invoking user's /etc/passwd entry if not).  This flag is off\nby default.\n\nstaysetuid       Normally, when sudo executes a command the real and effective user-IDs  are\nset  to the target user (root by default).  This option changes that behav‐\nior such that the real user-ID is left as the invoking user's user-ID.   In\nother  words,  this  makes  sudo act as a set-user-ID wrapper.  This can be\nuseful on systems that disable  some  potentially  dangerous  functionality\nwhen  a  program is run set-user-ID.  This option is only effective on sys‐\ntems that support either the setreuid(2) or setresuid(2) system call.  This\nflag is off by default.\n\nsudoeditcheckdir\nIf set, sudoedit will check all directory components  of  the  path  to  be\nedited  for  writability  by the invoking user.  Symbolic links will not be\nfollowed in writable directories and sudoedit will refuse to  edit  a  file\nlocated  in a writable directory.  These restrictions are not enforced when\nsudoedit is run by root.  On some systems, if all directory  components  of\nthe path to be edited are not readable by the target user, sudoedit will be\nunable to edit the file.  This flag is on by default.\n\nThis  setting was first introduced in version 1.8.15 but initially suffered\nfrom a race condition.  The check for symbolic links in writable intermedi‐\nate directories was added in version 1.8.16.\n\nsudoeditfollow   By default, sudoedit will not follow symbolic  links  when  opening  files.\nThe  sudoeditfollow  option  can be enabled to allow sudoedit to open sym‐\nbolic links.  It may be overridden on a per-command basis by the FOLLOW and\nNOFOLLOW tags.  This flag is off by default.\n\nThis setting is only supported by version 1.8.15 or higher.\n\nsyslogpid        When logging via syslog(3), include the process ID in the log entry.   This\nflag is off by default.\n\nThis setting is only supported by version 1.8.21 or higher.\n\ntargetpw          If  set,  sudo will prompt for the password of the user specified by the -u\noption (defaults to the value of runasdefault) instead of the password  of\nthe invoking user when running a command or editing a file.  This flag pre‐\ncludes  the  use of a user-ID not listed in the passwd database as an argu‐\nment to the -u option.  This flag is off by default.\n\nttytickets       If set, users must authenticate on a per-tty basis.   With  this  flag  en‐\nabled, sudo will use a separate record in the time stamp file for each ter‐\nminal.  If disabled, a single record is used for all login sessions.\n\nThis option has been superseded by the timestamptype option.\n\numaskoverride    If  set,  sudo  will set the umask as specified in the sudoers file without\nmodification.  This makes it possible to specify a  umask  in  the  sudoers\nfile that is more permissive than the user's own umask and matches histori‐\ncal  behavior.  If umaskoverride is not set, sudo will set the umask to be\nthe union of the user's umask and what is specified in sudoers.  This  flag\nis off by default.\n\nusenetgroups     If  set,  netgroups  (prefixed with ‘+’), may be used in place of a user or\nhost.  For LDAP-based sudoers, netgroup support requires an expensive  sub-\nstring match on the server unless the NETGROUPBASE directive is present in\nthe  /etc/ldap.conf  file.  If netgroups are not needed, this option can be\ndisabled to reduce the load on the LDAP server.  This flag  is  on  by  de‐\nfault.\n\nusepty           If set, and sudo is running in a terminal, the command will be run in a new\npseudo-terminal.   If  the  sudo  process  is  not  attached to a terminal,\nusepty has no effect.\n\nA malicious program run under sudo may be  capable  of  injecting  commands\ninto  the  user's terminal or running a background process that retains ac‐\ncess to the user's terminal device even after the main program has finished\nexecuting.  By running the command in a separate pseudo-terminal, this  at‐\ntack is no longer possible.  This flag is on by default for sudo 1.9.14 and\nabove.\n\nusercommandtimeouts\nIf set, the user may specify a timeout on the command line.  If the timeout\nexpires  before the command has exited, the command will be terminated.  If\na timeout is specified both in the sudoers file and on  the  command  line,\nthe smaller of the two timeouts will be used.  See the TimeoutSpec section\nfor a description of the timeout syntax.  This flag is off by default.\n\nThis setting is only supported by version 1.8.20 or higher.\n\nutmprunas        If  set,  sudo will store the name of the runas user when updating the utmp\n(or utmpx) file.  By default, sudo stores the name of  the  invoking  user.\nThis flag is off by default.\n\nvisiblepw         By  default,  sudo will refuse to run if the user must enter a password but\nit is not possible to disable echo on the terminal.  If the visiblepw  flag\nis  set,  sudo  will prompt for a password even when it would be visible on\nthe screen.  This makes it possible to run things like ‘ssh  somehost  sudo\nls’  since  by  default, ssh(1) does not allocate a tty when running a com‐\nmand.  This flag is off by default.\n\nIntegers:\n\nclosefrom         Before it executes a command, sudo will close  all  open  file  descriptors\nother  than  standard  input, standard output, and standard error (file de‐\nscriptors 0-2).  The closefrom option can be used to  specify  a  different\nfile descriptor at which to start closing.  The default is 3.\n\ncommandtimeout   The  maximum amount of time a command is allowed to run before it is termi‐\nnated.  See the TimeoutSpec section for a description of the timeout  syn‐\ntax.\n\nThis setting is only supported by version 1.8.20 or higher.\n\nlogservertimeout\nThe maximum amount of time to wait when connecting to a log server or wait‐\ning  for a server response.  See the TimeoutSpec section for a description\nof the timeout syntax.  The default value is 30 seconds.\n\nThis setting is only supported by version 1.9.0 or higher.\n\nmaxseq            The maximum sequence number that will be substituted for the  ‘%{seq}’  es‐\ncape  in the I/O log file (see the iologdir description below for more in‐\nformation).  While the value substituted for ‘%{seq}’ is in base 36, maxseq\nitself should be expressed  in  decimal.   Values  larger  than  2176782336\n(which  corresponds  to  the  base  36  sequence  number  “ZZZZZZ”) will be\nsilently truncated to 2176782336.  The default value is 2176782336.\n\nOnce the local sequence number reaches the value of maxseq, it  will  “roll\nover”  to  zero,  after which sudoers will truncate and re-use any existing\nI/O log path names.\n\nThis setting is only supported by version 1.8.7 or higher.\n\npasswdtries      The number of tries a user gets to enter his/her password before sudo  logs\nthe failure and exits.  The default is 3.\n\nsyslogmaxlen     On  many  systems,  syslog(3)  has a relatively small log buffer.  IETF RFC\n5424 states that syslog servers must support messages of at least 480 bytes\nand should support messages up to 2048 bytes.  By default, sudoers  creates\nlog  messages  up to 980 bytes which corresponds to the historic BSD syslog\nimplementation which used a 1024 byte buffer to store  the  message,  date,\nhostname,  and  program  name.  To prevent syslog messages from being trun‐\ncated,  sudoers  will  split  up  log  messages  that   are   larger   than\nsyslogmaxlen  bytes.   When  a message is split, additional parts will in‐\nclude the string “(command continued)” after the user name and  before  the\ncontinued command line arguments.\n\nThis setting is only supported by version 1.8.19 or higher.\n\nIntegers that can be used in a boolean context:\n\nloglinelen        Number  of characters per line for the file log.  This value is used to de‐\ncide when to wrap lines for nicer log files.  This has  no  effect  on  the\nsyslog log file, only the file log.  The default is 80 (use 0 or negate the\noption to disable word wrap).\n\npasswdtimeout    Number  of  minutes  before the sudo password prompt times out, or 0 for no\ntimeout.  The timeout may include a fractional component if  minute  granu‐\nlarity is insufficient, for example 2.5.  The default is 0.\n\ntimestamptimeout\nNumber  of  minutes  that  can  elapse  before sudo will ask for a password\nagain.  The timeout may include a fractional component if minute  granular‐\nity is insufficient, for example 2.5.  The default is 15.  Set this to 0 to\nalways  prompt  for  a  password.  If set to a value less than 0 the user's\ntime stamp will not expire until the system is rebooted.  This can be  used\nto  allow users to create or delete their own time stamps via ‘sudo -v’ and\n‘sudo -k’ respectively.\n\numask             File mode creation mask to use when running the command.  Negate  this  op‐\ntion  or set it to 0777 to prevent sudoers from changing the umask.  Unless\nthe umaskoverride flag is set, the actual umask will be the union  of  the\nuser's  umask  and  the value of the umask setting, which defaults to 0022.\nThis guarantees that sudo never lowers the umask when running a command.\n\nIf umask is explicitly set in sudoers, it will override any  umask  setting\nin  PAM or login.conf.  If umask is not set in sudoers, the umask specified\nby PAM or login.conf will take precedence.  The umask setting in PAM is not\nused for sudoedit, which does not create a new PAM session.\n\nStrings:\n\napparmorprofile  The default AppArmor profile to transition into when executing the command.\nThe default apparmorprofile can be overridden for individual  sudoers  en‐\ntries  by  specifying  the  APPARMORPROFILE  option.   This option is only\navailable when sudo is built with AppArmor support.\n\nauthfailmessage  Message that is displayed after a user fails to authenticate.  The  message\nmay include the ‘%d’ escape which will expand to the number of failed pass‐\nword  attempts.   If  set,  it overrides the default message, “%d incorrect\npassword attempt(s)”.\n\nbadpassmessage   Message that is displayed if a user enters an incorrect password.  The  de‐\nfault is “Sorry, try again.” unless insults are enabled.\n\neditor            A  colon  (‘:’)  separated  list  of editor path names used by sudoedit and\nvisudo.  For sudoedit, this list is used to find an editor when none of the\nSUDOEDITOR, VISUAL or EDITOR environment variables are set  to  an  editor\nthat  exists  and is executable.  For visudo, it is used as a white list of\nallowed editors; visudo will choose the  editor  that  matches  the  user's\nSUDOEDITOR,  VISUAL  or  EDITOR  environment  variable if possible, or the\nfirst editor in the list that exists and is executable if not.  Unless  in‐\nvoked as sudoedit, sudo does not preserve the SUDOEDITOR, VISUAL or EDITOR\nenvironment  variables  unless they are present in the envkeep list or the\nenvreset option is disabled.  The default is /usr/bin/editor.\n\nintercepttype    The underlying mechanism used by the intercept and logsubcmds options.  It\nhas the following possible values:\n\ndso     Preload a dynamic shared object (shared  library)  that  intercepts\nthe execve(2), execl(3), execle(3), execlp(3), execv(3), execvp(3),\nexecvpe(3), and system(3) library functions.  A value of dso is in‐\ncompatible with sudo's SELinux RBAC support.\n\ntrace   Use ptrace(2) to intercept the execve(2) system call.  This is only\nsupported  on  Linux systems where seccomp(2) filtering is enabled.\nIf the /proc/sys/kernel/seccomp/actionsavail file  is  missing  or\ndoes  not contain a “trap” element, setting intercepttype to trace\nwill have no effect and dso will be used instead.\n\nThe default is to use trace if it is supported by the system and dso if  it\nis not.\n\niologdir         The  top-level directory to use when constructing the path name for the in‐\nput/output log directory.  Only used if the loginput or logoutput options\nare enabled or when the LOGINPUT or LOGOUTPUT tags are present for a com‐\nmand.  The session sequence number, if any, is  stored  in  the  directory.\nThe default is /var/log/sudo-io.\n\nThe following percent (‘%’) escape sequences are supported:\n\n%{seq}\nexpanded  to a monotonically increasing base-36 sequence number, such\nas 0100A5, where every two digits are used to form a  new  directory,\ne.g., 01/00/A5\n\n%{user}\nexpanded to the invoking user's login name\n\n%{group}\nexpanded to the name of the invoking user's real group-ID\n\n%{runasuser}\nexpanded  to  the  login  name of the user the command will be run as\n(e.g., root)\n\n%{runasgroup}\nexpanded to the group name of the user the command  will  be  run  as\n(e.g., wheel)\n\n%{hostname}\nexpanded to the local host name without the domain name\n\n%{command}\nexpanded to the base name of the command being run\n\nIn  addition,  any  escape  sequences supported by the system's strftime(3)\nfunction will be expanded.\n\nTo include a literal ‘%’ character, the string ‘%%’ should be used.\n\nAny path name separator characters (‘/’) present in the user, group or host\nname will be replaced with an underbar (‘’) during expansion.\n\niologfile        The path name, relative to iologdir, in which to store  input/output  logs\nwhen  the loginput or logoutput options are enabled or when the LOGINPUT\nor LOGOUTPUT tags are present for a command.  iologfile may  contain  di‐\nrectory components.  The default is ‘%{seq}’.\n\nSee the iologdir option above for a list of supported percent (‘%’) escape\nsequences.\n\nIn  addition to the escape sequences, path names that end in six or more Xs\nwill have the Xs replaced with a unique combination of digits and  letters,\nsimilar to the mktemp(3) function.\n\nIf  the  path created by concatenating iologdir and iologfile already ex‐\nists, the existing I/O log file will be truncated  and  overwritten  unless\niologfile ends in six or more Xs.\n\niologflush       If  set,  sudo  will flush I/O log data to disk after each write instead of\nbuffering it.  This makes it possible to view the logs in real-time as  the\nprogram  is executing but may significantly reduce the effectiveness of I/O\nlog compression.  This flag is off by default.\n\nThis setting is only supported by version 1.8.20 or higher.\n\niologgroup       The group name to look up when setting the group-ID on new  I/O  log  files\nand  directories.   If  iologgroup is not set, the primary group-ID of the\nuser  specified  by  iologuser  is  used.   If  neither  iologgroup   nor\niologuser are set, I/O log files and directories are created with group-ID\n0.\n\nThis setting is only supported by version 1.8.19 or higher.\n\niologmode        The  file  mode to use when creating I/O log files.  Mode bits for read and\nwrite permissions for owner, group, or other are honored,  everything  else\nis  ignored.   The  file permissions will always include the owner read and\nwrite bits, even if they are not present in the specified mode.  When  cre‐\nating  I/O  log  directories,  search (execute) bits are added to match the\nread and write bits specified by iologmode.  Defaults to  0600  (read  and\nwrite by user only).\n\nThis setting is only supported by version 1.8.19 or higher.\n\niologuser        The user name to look up when setting the user and group-IDs on new I/O log\nfiles  and  directories.  If iologgroup is set, it will be used instead of\nthe user's primary group-ID.  By default, I/O log files and directories are\ncreated with user and group-ID 0.\n\nThis setting can be useful when the I/O logs are stored on a  Network  File\nSystem  (NFS)  share.   Having a dedicated user own the I/O log files means\nthat sudoers does not write to the log files as user-ID 0, which is usually\nnot permitted by NFS.\n\nThis setting is only supported by version 1.8.19 or higher.\n\nlecturestatusdir\nThe directory in which sudo stores per-user lecture status files.   Once  a\nuser has received the lecture, a zero-length file is created in this direc‐\ntory  so  that sudo will not lecture the user again.  This directory should\nnot   be   cleared   when   the   system   reboots.    The    default    is\n/var/lib/sudo/lectured.\n\nlogservercabundle\nThe  path to a certificate authority bundle file, in PEM format, to use in‐\nstead of the system's default certificate authority database when authenti‐\ncating the log server.  The default is to use the system's default certifi‐\ncate authority database.  This setting has no effect unless logservers  is\nset and the remote log server is secured with TLS.\n\nThis setting is only supported by version 1.9.0 or higher.\n\nlogserverpeercert\nThe  path  to the sudo client's certificate file, in PEM format.  This set‐\nting is required when the remote log server is secured with TLS and  client\ncertificate  validation  is  enabled.  For sudologsrvd, client certificate\nvalidation is controlled by the tlscheckpeer  option,  which  defaults  to\nfalse.\n\nThis setting is only supported by version 1.9.0 or higher.\n\nlogserverpeerkey\nThe  path  to the sudo client's private key file, in PEM format.  This set‐\nting is required when the remote log server is secured with TLS and  client\ncertificate  validation  is  enabled.  For sudologsrvd, client certificate\nvalidation is controlled by  the  tlscheckpeer  flag,  which  defaults  to\nfalse.\n\nThis setting is only supported by version 1.9.0 or higher.\n\nmailsub           Subject  of  the mail sent to the mailto user.  The escape ‘%h’ will expand\nto the host name of the machine.  Default is “* SECURITY information  for\n%h *”.\n\nnoexecfile       As  of  sudo version 1.8.1 this option is no longer supported.  The path to\nthe noexec file should now be set in the sudo.conf(5) file.\n\npamaskpassservice\nOn systems that use PAM for authentication, this is the service  name  used\nwhen  the  -A  option  is specified.  The default value is either ‘sudo’ or\n‘sudo-i’, depending on whether or not the -i option is also specified.  See\nthe description of pamservice for more information.\n\nThis setting is only supported by version 1.9.9 or higher.\n\npamloginservice\nOn systems that use PAM for authentication, this is the service  name  used\nwhen  the  -i option is specified.  The default value is ‘sudo-i’.  See the\ndescription of pamservice for more information.\n\nThis setting is only supported by version 1.8.8 or higher.\n\npamservice       On systems that use PAM for authentication, the service name specifies  the\nPAM  policy to apply.  This usually corresponds to an entry in the pam.conf\nfile or a file in the /etc/pam.d directory.  The default value is ‘sudo’.\n\nThis setting is only supported by version 1.8.8 or higher.\n\npassprompt        The default prompt to use when asking for a password; can be overridden via\nthe -p option or the SUDOPROMPT environment variable.  The following  per‐\ncent (‘%’) escape sequences are supported:\n\n%H    expanded  to  the  local host name including the domain name (only if\nthe machine's host name is fully qualified or the fqdn option is set)\n\n%h    expanded to the local host name without the domain name\n\n%p    expanded to the user whose password is being asked for (respects  the\nrootpw, targetpw and runaspw flags in sudoers)\n\n%U    expanded  to  the  login  name of the user the command will be run as\n(defaults to root)\n\n%u    expanded to the invoking user's login name\n\n%%    two consecutive ‘%’ characters are collapsed into a single ‘%’  char‐\nacter\n\nOn systems that use PAM for authentication, passprompt will only be used if\nthe  prompt  provided  by the PAM module matches the string “Password: ” or\n“username's Password: ”.  This ensures that the passprompt setting does not\ninterfere    with    challenge-response    style    authentication.     The\npasspromptoverride flag can be used to change this behavior.\n\nThe default value is ‘[sudo] password for %p: ’.\n\nrole              The default SELinux role to use when constructing a new security context to\nrun the command.  The default role may be overridden on a per-command basis\nin  the  sudoers  file  or  via  command line options.  This option is only\navailable when sudo is built with SELinux support.\n\nrunasdefault     The default user to run commands as if the -u option is  not  specified  on\nthe command line.  This defaults to root.\n\nsudoerslocale    Locale  to use when parsing the sudoers file, logging commands, and sending\nemail.  Changing the locale may affect how  sudoers  is  interpreted.   De‐\nfaults to ‘C’.\n\ntimestamptype    sudoers  uses  per-user  time  stamp  files  for  credential  caching.  The\ntimestamptype option can be used to specify the type of time stamp  record\nused.  It has the following possible values:\n\nglobal  A  single  time stamp record is used for all of a user's login ses‐\nsions, regardless of the terminal or parent process ID.   An  addi‐\ntional  record  is  used to serialize password prompts when sudo is\nused multiple times in a pipeline, but this does not affect authen‐\ntication.\n\nppid    A single time stamp record is used for all processes with the  same\nparent  process ID (usually the shell).  Commands run from the same\nshell (or other common parent process) will not require a  password\nfor  timestamptimeout  minutes  (15 by default).  Commands run via\nsudo with a different parent process ID, for example from  a  shell\nscript, will be authenticated separately.\n\ntty     One time stamp record is used for each terminal, which means that a\nuser's login sessions are authenticated separately.  If no terminal\nis  present,  the  behavior is the same as ppid.  Commands run from\nthe same terminal will not require a password for timestamptimeout\nminutes (15 by default).\n\nkernel  The time stamp is stored in the kernel as an attribute of the  ter‐\nminal  device.  If no terminal is present, the behavior is the same\nas ppid.  Negative timestamptimeout values are not  supported  and\npositive  values  are  limited to a maximum of 60 minutes.  This is\ncurrently only supported on OpenBSD.\n\nThe default value is tty.\n\nThis setting is only supported by version 1.8.21 or higher.\n\ntimestampdir      The directory in which sudo stores its time stamp  files.   This  directory\nshould be cleared when the system reboots.  The default is /run/sudo/ts.\n\ntimestampowner    The  owner  of  the  lecture status directory, time stamp directory and all\nfiles stored therein.  The default is root.\n\ntype              The default SELinux type to use when constructing a new security context to\nrun the command.  The default type may be overridden on a per-command basis\nin the sudoers file or via command  line  options.   This  option  is  only\navailable when sudo is built with SELinux support.\n\nStrings that can be used in a boolean context:\n\nadminflag    The  adminflag  option  specifies the path to a file that is created the first\ntime a user that is a member of the sudo  or  admin  groups  runs  sudo.   Only\navailable  if  sudo is configured with the --enable-admin-flag option.  The de‐\nfault value is ~/.sudoasadminsuccessful.\n\nenvfile      The envfile option specifies the fully qualified path  to  a  file  containing\nvariables  to  be  set in the environment of the program being run.  Entries in\nthis  file  should  either  be  of  the  form   ‘VARIABLE=value’   or   ‘export\nVARIABLE=value’.   The  value  may  optionally  be enclosed in single or double\nquotes.  Variables in this file are only added if the variable does not already\nexist in the environment.  This file is considered to be part of  the  security\npolicy,  its  contents  are  not subject to other sudo environment restrictions\nsuch as envkeep and envcheck.\n\nexemptgroup  Users in this group are exempt from password and PATH requirements.  The  group\nname specified should not include a ‘%’ prefix.  This is not set by default.\n\nfdexec        Determines  whether  sudo will execute a command by its path or by an open file\ndescriptor.  It has the following possible values:\n\nalways  Always execute by file descriptor.\n\nnever   Never execute by file descriptor.\n\ndigestonly\nOnly execute by file descriptor if the command has an associated digest\nin the sudoers file.\n\nThe default value is digestonly.  This avoids a time of check versus  time  of\nuse  race  condition when the command is located in a directory writable by the\ninvoking user.\n\nfdexec will change the first element of the argument vector for scripts ($0  in\nthe  shell) due to the way the kernel runs script interpreters.  Instead of be‐\ning a normal path, it will refer to a file descriptor.  For example,  /dev/fd/4\non  Solaris  and  /proc/self/fd/4  on  Linux.   A  workaround  is  to  use  the\nSUDOCOMMAND environment variable instead.\n\nThe fdexec setting is only used when the command is matched by path  name.   It\nhas no effect if the command is matched by the built-in ALL alias.\n\nThis  setting  is only supported by version 1.8.20 or higher.  If the operating\nsystem does not support the fexecve(2) system call, this setting has no effect.\n\ngroupplugin  A string containing a sudoers group plugin with optional arguments.  The string\nshould consist of the plugin path, either fully-qualified or  relative  to  the\n/usr/libexec/sudo directory, followed by any configuration arguments the plugin\nrequires.   These arguments (if any) will be passed to the plugin's initializa‐\ntion function.  If arguments are present, the string must be enclosed in double\nquotes (\"\").\n\nOn 64-bit systems, if the plugin is present but cannot be loaded, sudoers  will\nlook  for a 64-bit version and, if it exists, load that as a fallback.  The ex‐\nact rules for this vary by system.  On Solaris, if the plugin is  stored  in  a\ndirectory  ending  in  “lib”,  sudoers will create a fallback path by appending\n“/64”    to    the    directory    name;    /usr/lib/groupplugin.so    becomes\n/usr/lib/64/groupplugin.so.   On  Linux,  a  directory ending in “lib” will be\ntransformed to “lib64” as the fallback path;  /usr/lib/groupplugin.so  becomes\n/usr/lib64/groupplugin.so.   On all other systems, the fallback path is gener‐\nated by adding a  “64”  before  the  file  extension;  groupplugin.so  becomes\ngroupplugin64.so.\n\nOn  AIX systems, the plugin may be either a shared object ending in ‘.so’ or an\narchive file containing a shared object ending in ‘.a’ with  the  name  of  the\nshared object in parentheses at the end.\n\nFor more information see “GROUP PROVIDER PLUGINS”.\n\nlecture       This  option controls when a short lecture will be printed along with the pass‐\nword prompt.  It has the following possible values:\n\nalways  Always lecture the user.\n\nnever   Never lecture the user.\n\nonce    Only lecture the user the first time they run sudo.\n\nIf no value is specified, a value of once is implied.  Negating the option  re‐\nsults in a value of never being used.  The default value is never.\n\nlecturefile  Path  to a file containing an alternate sudo lecture that will be used in place\nof the standard lecture if the named file exists.   By  default,  sudo  uses  a\nbuilt-in lecture.\n\nlistpw        This  option  controls  when  a password will be required when a user runs sudo\nwith the -l option.  It has the following possible values:\n\nall   All the user's sudoers file entries for the current host  must  have  the\nNOPASSWD flag set to avoid entering a password.\n\nalways\nThe user must always enter a password to use the -l option.\n\nany   At least one of the user's sudoers file entries for the current host must\nhave the NOPASSWD flag set to avoid entering a password.\n\nnever\nThe user need never enter a password to use the -l option.\n\nIf  no  value is specified, a value of any is implied.  Negating the option re‐\nsults in a value of never being used.  The default value is any.\n\nlogformat    The event log format.  Supported log formats are:\n\njson  Logs in JSON format.  JSON log entries contain the full user  details  as\nwell  as  the  execution  environment if the command was allowed.  Due to\nlimitations of the protocol, JSON events sent via  syslog  may  be  trun‐\ncated.\n\nsudo  Traditional sudo-style logs, see “EVENT LOGGING” for a description of the\nlog file format.\n\nThis  setting  affects logs sent via syslog(3) as well as the file specified by\nthe logfile setting, if any.  The default value is sudo.\n\nlogfile       Path to the sudo log file (not the syslog log file).  Setting a path  turns  on\nlogging  to  a  file; negating this option turns it off.  By default, sudo logs\nvia syslog.\n\nmailerflags   Flags to use when invoking mailer.  Defaults to -t.\n\nmailerpath    Path to mail program used to send warning mail (negate  to  prevent  sudo  from\nsending mail).  Defaults to the path to sendmail found at configure time.\n\nmailfrom      Address to use for the “from” address when sending warning and error mail.  The\naddress should be enclosed in double quotes (\"\") to protect against sudo inter‐\npreting the ‘@’ sign.  Defaults to the name of the user running sudo.\n\nmailto        Address  to send warning and error mail to (negate to prevent sudo from sending\nmail).  The address should be enclosed in double quotes (\"\") to protect against\nsudo interpreting the ‘@’ sign.  Defaults to root.\n\nrlimitas     The maximum size to which the process's address space may grow (in  bytes),  if\nsupported by the operating system.  See “Resource limits” for more information.\n\nrlimitcore   The  largest size core dump file that may be created (in bytes).  See “Resource\nlimits” for more information.  Defaults to 0 (no core dump created).\n\nrlimitcpu    The maximum amount of CPU time that the process  may  use  (in  seconds).   See\n“Resource limits” for more information.\n\nrlimitdata   The maximum size of the data segment for the process (in bytes).  See “Resource\nlimits” for more information.\n\nrlimitfsize  The  largest  size  file that the process may create (in bytes).  See “Resource\nlimits” for more information.\n\nrlimitlocks  The maximum number of locks that the process may establish, if supported by the\noperating system.  See “Resource limits” for more information.\n\nrlimitmemlock\nThe maximum size that the process may lock in memory (in bytes),  if  supported\nby the operating system.  See “Resource limits” for more information.\n\nrlimitnofile\nThe  maximum  number  of  files  that the process may have open.  See “Resource\nlimits” for more information.\n\nrlimitnproc  The maximum number of processes that the  user  may  run  simultaneously.   See\n“Resource limits” for more information.\n\nrlimitrss    The  maximum size to which the process's resident set size may grow (in bytes).\nSee “Resource limits” for more information.\n\nrlimitstack  The maximum size to which  the  process's  stack  may  grow  (in  bytes).   See\n“Resource limits” for more information.\n\nrestrictedenvfile\nThe  restrictedenvfile  option  specifies  the fully qualified path to a file\ncontaining variables to be set in the environment of  the  program  being  run.\nEntries  in  this file should either be of the form ‘VARIABLE=value’ or ‘export\nVARIABLE=value’.  The value may optionally be  enclosed  in  single  or  double\nquotes.  Variables in this file are only added if the variable does not already\nexist in the environment.  Unlike envfile, the file's contents are not trusted\nand  are  processed in a manner similar to that of the invoking user's environ‐\nment.  If envreset is enabled, variables in the file will  only  be  added  if\nthey  are  matched  by  either the envcheck or envkeep list.  If envreset is\ndisabled, variables in the file are added as long as they are  not  matched  by\nthe  envdelete  list.  In either case, the contents of restrictedenvfile are\nprocessed before the contents of envfile.\n\nrunchroot     If set, sudo will use this value for the root directory when running a command.\nThe special value “*” will allow the user to specify  the  root  directory  via\nsudo's -R option.  See the “ChrootSpec” section for more details.\n\nIt  is only possible to use runchroot as a command-specific Defaults setting if\nthe command exists with the same path both inside and outside the chroot  jail.\nThis  restriction  does  not apply to global, host, or user-based Defaults set‐\ntings or to a CmndSpec that includes a ChrootSpec.\n\nThis setting is only supported by version 1.9.3 or higher.\n\nruncwd        If set, sudo will use this value for the working directory when running a  com‐\nmand.   The special value “*” will allow the user to specify the working direc‐\ntory via sudo's -D option.  See the “ChdirSpec” section for more details.\n\nThis setting is only supported by version 1.9.3 or higher.\n\nsecurepath   If set, sudo will use this value in place of the user's PATH environment  vari‐\nable.   This  option  can  be used to reset the PATH to a known good value that\ncontains directories for system administrator commands such as /usr/sbin.\n\nUsers in the group specified by the exemptgroup option  are  not  affected  by\nsecurepath.  This option is not set by default.\n\nsyslog        Syslog  facility  if syslog is being used for logging (negate to disable syslog\nlogging).  Defaults to authpriv.\n\nThe following syslog facilities are supported: authpriv (if  your  OS  supports\nit),  auth,  daemon,  user,  local0,  local1,  local2,  local3, local4, local5,\nlocal6, and local7.\n\nsyslogbadpri\nSyslog priority to use when the user is not allowed to run a  command  or  when\nauthentication is unsuccessful.  Defaults to alert.\n\nThe  following syslog priorities are supported: alert, crit, debug, emerg, err,\ninfo, notice, warning, and none.  Negating the option or setting it to a  value\nof none will disable logging of unsuccessful commands.\n\nsysloggoodpri\nSyslog  priority to use when the user is allowed to run a command and authenti‐\ncation is successful.  Defaults to notice.\n\nSee syslogbadpri for the list of supported syslog  priorities.   Negating  the\noption or setting it to a value of none will disable logging of successful com‐\nmands.\n\nverifypw      This  option  controls  when  a password will be required when a user runs sudo\nwith the -v option.  It has the following possible values:\n\nall     All the user's sudoers file entries for the current host must have  the\nNOPASSWD flag set to avoid entering a password.\n\nalways  The user must always enter a password to use the -v option.\n\nany     At  least  one  of the user's sudoers file entries for the current host\nmust have the NOPASSWD flag set to avoid entering a password.\n\nnever   The user need never enter a password to use the -v option.\n\nIf no value is specified, a value of all is implied.  Negating the  option  re‐\nsults in a value of never being used.  The default value is all.\n\nLists that can be used in a boolean context:\n\nenvcheck         Environment variables to be removed from the user's environment unless they\nare  considered “safe”.  For all variables except TZ, “safe” means that the\nvariable's value does not contain any ‘%’ or ‘/’ characters.  This  can  be\nused to guard against printf-style format vulnerabilities in poorly-written\nprograms.  The TZ variable is considered unsafe if any of the following are\ntrue:\n\n•  It  consists  of a fully-qualified path name, optionally prefixed with a\ncolon (‘:’), that does not match the location of the zoneinfo directory.\n\n•  It contains a .. path element.\n\n•  It contains white space or non-printable characters.\n\n•  It is longer than the value of PATHMAX.\n\nThe argument may be a double-quoted, space-separated list or a single value\nwithout double-quotes.  The list can be replaced, added to,  deleted  from,\nor  disabled  by using the ‘=’, ‘+=’, ‘-=’, and ‘!’ operators respectively.\nRegardless of whether the envreset option is enabled  or  disabled,  vari‐\nables  specified  by envcheck will be preserved in the environment if they\npass the aforementioned check.  The global list of environment variables to\ncheck is displayed when sudo is run by root with the -V option.\n\nenvdelete        Environment variables to be removed from the user's  environment  when  the\nenvreset  option  is  not in effect.  The argument may be a double-quoted,\nspace-separated list or a single value without double-quotes.  The list can\nbe replaced, added to, deleted from, or disabled by using  the  ‘=’,  ‘+=’,\n‘-=’, and ‘!’ operators respectively.  The global list of environment vari‐\nables  to  remove is displayed when sudo is run by root with the -V option.\nMany operating systems will remove potentially dangerous variables from the\nenvironment of any set-user-ID process (such as sudo).\n\nenvkeep          Environment variables to be preserved in the user's  environment  when  the\nenvreset  option  is in effect.  This allows fine-grained control over the\nenvironment sudo-spawned processes will receive.  The  argument  may  be  a\ndouble-quoted,  space-separated  list  or  a  single  value without double-\nquotes.  The list can be replaced, added to, deleted from, or  disabled  by\nusing the ‘=’, ‘+=’, ‘-=’, and ‘!’ operators respectively.  The global list\nof  variables to keep is displayed when sudo is run by root with the -V op‐\ntion.\n\nPreserving the HOME environment variable has  security  implications  since\nmany  programs  use  it  when  searching  for  configuration or data files.\nAdding HOME to envkeep may enable a user to run unrestricted commands  via\nsudo  and  is  strongly discouraged.  Users wishing to edit files with sudo\nshould run sudoedit (or sudo -e) to get their accustomed editor  configura‐\ntion instead of invoking the editor directly.\n\nlogservers       A  list of one or more servers to use for remote event and I/O log storage,\nseparated by white space.  Log servers must be running sudologsrvd or  an‐\nother    service    that    implements    the    protocol    described   by\nsudologsrv.proto(5).\n\nServer addresses should be of the form “host[:port][(tls)]”.  The host por‐\ntion may be a host name, an IPv4 address, or  an  IPv6  address  in  square\nbrackets.\n\nIf  the  optional  tls flag is present, the connection will be secured with\nTransport Layer Security (TLS) version 1.2 or 1.3.  Versions of  TLS  prior\nto 1.2 are not supported.\n\nIf a port is specified, it may either be a port number or a well-known ser‐\nvice  name  as  defined by the system service name database.  If no port is\nspecified, port 30343 will be used for plaintext connections and port 30344\nwill be used for TLS connections.\n\nWhen logservers is set, event log data will be logged  both  locally  (see\nthe  syslog  and  logfile  settings) as well as remotely, but I/O log data\nwill only be logged remotely.  If multiple hosts are specified,  they  will\nbe  attempted  in reverse order.  If no log servers are available, the user\nwill not be able to run a command  unless  either  the  ignoreiologerrors\nflag  (I/O logging enabled) or the ignorelogerrors flag (I/O logging dis‐\nabled) is set.  Likewise, if the connection to the  log  server  is  inter‐\nrupted  while  sudo  is  running, the command will be terminated unless the\nignoreiologerrors flag (I/O logging  enabled)  or  the  ignorelogerrors\nflag (I/O logging disabled) is set.\n\nThis setting is only supported by version 1.9.0 or higher.\n\npasspromptregex  A list of POSIX extended regular expressions used to match password prompts\nin  the terminal output.  As an extension, if the regular expression begins\nwith “(?i)”, it will be matched in a case-insensitive manner.  Each regular\nexpression is limited to 1024 characters.  This option is  only  used  when\nlogpasswords has been disabled.  The default value is “[Pp]assword[: ]*”\n\nThis setting is only supported by version 1.9.10 or higher.\n",
            "subsections": []
        },
        "GROUP PROVIDER PLUGINS": {
            "content": "The  sudoers  plugin  supports its own plugin interface to allow non-Unix group lookups which\ncan query a group source other than the standard Unix group database.  This can  be  used  to\nimplement support for the nonunixgroup syntax described earlier.\n\nGroup  provider  plugins  are  specified  via  the  groupplugin  setting.   The  argument to\ngroupplugin should consist of the plugin path, either fully-qualified  or  relative  to  the\n/usr/libexec/sudo  directory,  followed  by  any  configuration  options the plugin requires.\nThese options (if specified) will be passed to the plugin's initialization function.  If  op‐\ntions are present, the string must be enclosed in double quotes (\"\").\n\nThe following group provider plugins are installed by default:\n\ngroupfile\nThe groupfile plugin supports an alternate group file that uses the same syntax as the\n/etc/group  file.   The  path to the group file should be specified as an option to the\nplugin.  For example, if the group file to be used is /etc/sudo-group:\n\nDefaults groupplugin=\"groupfile.so /etc/sudo-group\"\n\nsystemgroup\nThe systemgroup plugin supports group lookups via the  standard  C  library  functions\ngetgrnam(3)  and  getgrid(3).   This plugin can be used in instances where the user be‐\nlongs to groups not present in the user's supplemental group vector.  This plugin takes\nno options:\n\nDefaults groupplugin=systemgroup.so\n\nThe group provider plugin API is described in detail in sudoplugin(5).\n",
            "subsections": []
        },
        "EVENT LOGGING": {
            "content": "sudoers can log events in either JSON or sudo format, this section  describes  the  sudo  log\nformat.  Depending on sudoers configuration, sudoers can log events via syslog(3), to a local\nlog file, or both.  The log format is almost identical in both cases.  Any control characters\npresent  in the log data are formatted in octal with a leading ‘#’ character.  For example, a\nhorizontal tab is stored as ‘#011’ and an embedded carriage return is stored as  ‘#015’.   In\naddition,  space characters in the command path are stored as ‘#040’.  Command line arguments\nthat contain spaces are enclosed in single quotes ('').  This makes it  possible  to  distin‐\nguish  multiple  command line arguments from a single argument that contains spaces.  Literal\nsingle quotes and backslash characters (‘\\’) in command line arguments  are  escaped  with  a\nbackslash.\n",
            "subsections": [
                {
                    "name": "Accepted command log entries",
                    "content": "Commands  that sudo runs are logged using the following format (split into multiple lines for\nreadability):\n\ndate hostname progname: username : TTY=ttyname ; CHROOT=chroot ; \\\nPWD=cwd ; USER=runasuser ; GROUP=runasgroup ; TSID=logid ; \\\nENV=envvars COMMAND=command\n\nWhere the fields are as follows:\n\ndate          The date the command was run.  Typically, this  is  in  the  format  “MMM,  DD,\nHH:MM:SS”.   If  logging via syslog(3), the actual date format is controlled by\nthe syslog daemon.  If logging to a file and the logyear  option  is  enabled,\nthe date will also include the year.\n\nhostname      The  name of the host sudo was run on.  This field is only present when logging\nvia syslog(3).\n\nprogname      The name of the program, usually sudo or sudoedit.  This field is only  present\nwhen logging via syslog(3).\n\nusername      The login name of the user who ran sudo.\n\nttyname       The  short name of the terminal (e.g., “console”, “tty01”, or “pts/0”) sudo was\nrun on, or “unknown” if there was no terminal present.\n\nchroot        The root directory that the command was run in, if one was specified.\n\ncwd           The current working directory that sudo was run in.\n\nrunasuser     The user the command was run as.\n\nrunasgroup    The group the command was run as if one was specified on the command line.\n\nlogid         An I/O log identifier that can be used to replay the command's output.  This is\nonly present when the loginput or logoutput option is enabled.\n\nenvvars      A list of environment variables specified on the command line, if specified.\n\ncommand       The actual command that was executed, including any command line arguments.\n\nMessages are logged using the locale specified by sudoerslocale, which defaults to  the  ‘C’\nlocale.\n"
                },
                {
                    "name": "Denied command log entries",
                    "content": "If the user is not allowed to run the command, the reason for the denial will follow the user\nname.  Possible reasons include:\n\nuser NOT in sudoers\nThe user is not listed in the sudoers file.\n\nuser NOT authorized on host\nThe user is listed in the sudoers file but is not allowed to run commands on the host.\n\ncommand not allowed\nThe  user  is  listed  in the sudoers file for the host but they are not allowed to run the\nspecified command.\n\n3 incorrect password attempts\nThe user failed to enter their password after 3 tries.  The actual  number  of  tries  will\nvary based on the number of failed attempts and the value of the passwdtries option.\n\na password is required\nThe -n option was specified but a password was required.\n\nsorry, you are not allowed to set the following environment variables\nThe  user  specified  environment  variables  on  the command line that were not allowed by\nsudoers.\n"
                },
                {
                    "name": "Error log entries",
                    "content": "If an error occurs, sudoers will log a message and, in most cases, send a message to the  ad‐\nministrator via email.  Possible errors include:\n\nparse error in /etc/sudoers near line N\nsudoers  encountered  an  error when parsing the specified file.  In some cases, the actual\nerror may be one line above or below the line number listed, depending on the type  of  er‐\nror.\n\nproblem with defaults entries\nThe  sudoers  file  contains  one or more unknown Defaults settings.  This does not prevent\nsudo from running, but the sudoers file should be checked using visudo.\n\ntimestamp owner (username): No such user\nThe time stamp directory owner, as specified by the timestampowner setting,  could  not  be\nfound in the password database.\n\nunable to open/read /etc/sudoers\nThe sudoers file could not be opened for reading.  This can happen when the sudoers file is\nlocated  on  a  remote  file  system  that  maps user-ID 0 to a different value.  Normally,\nsudoers tries to open the sudoers file using group permissions to avoid this problem.  Con‐\nsider  either  changing  the  ownership  of  /etc/sudoers  or  adding  an   argument   like\n“sudoersuid=N”  (where  ‘N’  is  the user-ID that owns the sudoers file) to the end of the\nsudoers Plugin line in the sudo.conf(5) file.\n\nunable to open /etc/sudoers\nThe /etc/sudoers file is missing.\n\n/etc/sudoers is not a regular file\nThe /etc/sudoers file exists but is not a regular file or symbolic link.\n\n/etc/sudoers is owned by uid N, should be 0\nThe sudoers file has the wrong owner.  If you wish to change the sudoers  file  owner,  add\n“sudoersuid=N” (where ‘N’ is the user-ID that owns the sudoers file) to the sudoers Plugin\nline in the sudo.conf(5) file.\n\n/etc/sudoers is world writable\nThe  permissions on the sudoers file allow all users to write to it.  The sudoers file must\nnot be world-writable, the default file mode is 0440 (readable by owner and group, writable\nby none).  The default mode may be changed via the “sudoersmode”  option  to  the  sudoers\nPlugin line in the sudo.conf(5) file.\n\n/etc/sudoers is owned by gid N, should be 1\nThe  sudoers  file  has  the wrong group ownership.  If you wish to change the sudoers file\ngroup ownership, add “sudoersgid=N” (where ‘N’ is the group-ID that owns the sudoers file)\nto the sudoers Plugin line in the sudo.conf(5) file.\n\nunable to open /run/sudo/ts/user-ID\nsudoers was unable to read or create the user's time stamp  file.   This  can  happen  when\ntimestampowner is set to a user other than root and the mode on /run/sudo is not searchable\nby group or other.  The default mode for /run/sudo is 0711.\n\nunable to write to /run/sudo/ts/user-ID\nsudoers was unable to write to the user's time stamp file.\n\n/run/sudo/ts is owned by uid X, should be Y\nThe time stamp directory is owned by a user other than timestampowner.  This can occur when\nthe value of timestampowner has been changed.  sudoers will ignore the time stamp directory\nuntil the owner is corrected.\n\n/run/sudo/ts is group writable\nThe  time  stamp directory is group-writable; it should be writable only by timestampowner.\nThe default mode for the time stamp directory is 0700.  sudoers will ignore the time  stamp\ndirectory until the mode is corrected.\n"
                },
                {
                    "name": "Notes on logging via syslog",
                    "content": "By default, sudoers logs messages via syslog(3).  The date, hostname, and progname fields are\nadded by the system's syslog(3) function, not sudoers itself.  As such, they may vary in for‐\nmat on different systems.\n\nThe  maximum size of syslog messages varies from system to system.  The syslogmaxlen setting\ncan be used to change the maximum syslog message size from the default value  of  980  bytes.\nFor more information, see the description of syslogmaxlen.\n"
                },
                {
                    "name": "Notes on logging to a file",
                    "content": "If  the logfile option is set, sudoers will log to a local file, such as /var/log/sudo.  When\nlogging to a file, sudoers uses a format similar to syslog(3), with a few  important  differ‐\nences:\n\n1.   The progname field is not present.\n\n2.   The hostname is only logged if the loghost option is enabled.\n\n3.   The date does not include the year unless the logyear option is enabled.\n\n4.   Lines  that  are  longer than loglinelen characters (80 by default) are word-wrapped and\ncontinued on the next line with a four character indent.  This makes entries  easier  to\nread for a human being, but makes it more difficult to use grep(1) on the log files.  If\nthe loglinelen option is set to 0 (or negated with a ‘!’), word wrap will be disabled.\n"
                }
            ]
        },
        "I/O LOGGING": {
            "content": "When  I/O  logging  is enabled, sudo will runs the command in a pseudo-terminal, logging user\ninput and/or output, depending on which sudoers flags are enabled.  There are  five  distinct\ntypes of I/O that can be logged, each with a corresponding sudoers flag.\n",
            "subsections": [
                {
                    "name": "Type               Flag          Description",
                    "content": "terminal input     logttyin     keystrokes entered by the user\nterminal output    logttyout    command output displayed to the screen\nstandard input     logstdin     input from a pipe or a file\nstandard output    logstdout    output to a pipe or a file\nstandard error     logstderr    output to a pipe or a file\n\nIn  addition  to  flags described the above, the loginput flag and LOGINPUT command tag set\nboth logttyin and logstdin.  The logoutput flag and LOGOUTPUT command tag set logttyout,\nlogstdout, and logstderr.\n\nTo capture terminal input and output, sudo run the command in a pseudo-terminal, logging  the\ninput  and  output before passing it on to the user.  To capture the standard input, standard\noutput or standard error, sudo uses a pipe to interpose itself between the  input  or  output\nstream, logging the I/O before passing it to the other end of the pipe.\n\nI/O can be logged either to the local machine or to a remote log server.  For local logs, I/O\nis  logged  to  the directory specified by the iologdir option (/var/log/sudo-io by default)\nusing a unique session ID that is included in the sudo log line, prefixed with ‘TSID=’.   The\niologfile  option may be used to control the format of the session ID.  For remote logs, the\nlogservers setting is used to specify one or more log servers running  sudologsrvd  or  an‐\nother server that implements the protocol described by sudologsrv.proto(5).\n"
                },
                {
                    "name": "I/O logging pitfals",
                    "content": "When logging standard input, anything sent to the standard input will be consumed, regardless\nof  whether or not the command run via sudo is actively reading the standard input.  This may\nhave unexpected results when using sudo in a shell script that expects to process  the  stan‐\ndard input.  For example, given the following shell script:\n\n#!/bin/sh\nsudo echo testing\necho done\n\nIt will behave as expected when the script is passed to the shell as a an argument:\n\n$ sh test.sh\ntesting\ndone\n\nHowever,  if the script is passed to the shell on the standard input, the ‘sudo echo testing’\ncommand will consume the rest of the script.  This means that the ‘echo  done’  statement  is\nnever executed.\n\n$ sh -s < test.sh\ntesting\n\nThere are several ways to work around this problem:\n\n1.   Redirect the standard input from /dev/null when running a command via sudo that does not\nneed to read the standard input.\n\nsudo echo testing < /dev/null\n\n2.   Pass the script to the shell by path name instead of via the standard input.\n\nsh test.sh\n\n3.   Disable  logging  the  standard input for commands that do not need to read the standard\ninput.\n\nDefaults!/bin/echo !logstdin\n\nDepending on the command, it may not be desirable to log the standard input or standard  out‐\nput.   For example, I/O logging of commands that send or receive large amount of data via the\nstandard output or standard input such as rsync(1) and tar(1) could fill up the log file sys‐\ntem with superfluous data.  It is possible to disable logging of the standard input and stan‐\ndard output for such commands as follows:\n\nCmndAlias COPYCMDS = /usr/bin/tar, /usr/bin/cpio, /usr/bin/rsync\n\n# Log input and output but omit stdin and stdout when copying files.\nDefaults loginput, logoutput\nDefaults!COPYCMDS !logstdin, !logstdout\n\nHowever, be aware that using the loginput flag or the LOGINPUT command tag will also enable\nlogstdin.  Likewise, the logouput flag or the LOGOUTPUT command tag will enable logstdout\nand logstderr. Careful ordering of rules may be necessary to achieve the  results  that  you\nexpect.\n"
                },
                {
                    "name": "I/O log format",
                    "content": "For  both local and remote I/O logs, each log is stored in a separate directory that contains\nthe following files:\n\nlog       A text file containing information about the command.  The first line  consists  of\nthe following colon-delimited fields: the time the command was run, the name of the\nuser  who  ran sudo, the name of the target user, the name of the target group (op‐\ntional), the terminal that sudo was run from, and the number of lines  and  columns\nof the terminal.  The second and third lines contain the working directory the com‐\nmand  was  run  from  and  the  path  name of the command itself (with arguments if\npresent).\n\nlog.json  A JSON-formatted file containing information about the command.  This is similar to\nthe log file but contains additional information and  is  easily  extensible.   The\nlog.json file will be used by sudoreplay(8) in preference to the log file if it ex‐\nists.  The file may contain the following elements:\n\ntimestamp\nA  JSON  object containing time the command was run.  It consists of two val‐\nues, seconds and nanoseconds.\n\ncolumns\nThe number of columns of the terminal the command ran on, or zero if no  ter‐\nminal was present.\n\ncommand\nThe fully-qualified path of the command that was run.\n\nlines\nThe  number of lines of the terminal the command ran on, or zero if no termi‐\nnal was present.\n\nrunargv\nA JSON array representing the command's argument  vector  as  passed  to  the\nexecve(2) system call.\n\nrunenv\nA  JSON  array  representing  the  command's  environment  as  passed  to the\nexecve(2) system call.\n\nrungid\nThe group ID the command ran as.  This element is only present when the  user\nspecifies a group on the command line.\n\nrungroup\nThe  name of the group the command ran as.  This element is only present when\nthe user specifies a group on the command line.\n\nrunuid\nThe user ID the command ran as.\n\nrunuser\nThe name of the user the command ran as.\n\nsubmitcwd\nThe current working directory at the time sudo was run.\n\nsubmithost\nThe name of the host the command was run on.\n\nsubmituser\nThe name of the user who ran the command via sudo.\n\nttyname\nThe path name of the terminal the user invoked sudo from.  If the command was\nrun in a pseudo-terminal, ttyname will be different  from  the  terminal  the\ncommand actually ran in.\n\ntiming    Timing  information  used to replay the session.  Each line consists of the I/O log\nentry type and amount of time since the last entry, followed by type-specific data.\nThe I/O log entry types and their corresponding type-specific data are:\n\n0     standard input, number of bytes in the entry\n1     standard output, number of bytes in the entry\n2     standard error, number of bytes in the entry\n3     terminal input, number of bytes in the entry\n4     terminal output, number of bytes in the entry\n5     window change, new number lines and columns\n6     bug compatibility for sudo 1.8.7 terminal output\n7     command suspend or resume, signal received\n\nttyin     Raw input from the user's terminal, exactly as it was received.  This file is  only\npresent  if the loginput or logttyin flags are set and sudo was run from a termi‐\nnal.  No post-processing is performed.  For manual viewing, you may wish to convert\ncarriage return characters in the log to line feeds.  For example: ‘gunzip -c ttyin\n| tr \"\\r\" \"\\n\"’\n\nstdin     The standard input when no terminal is present, or input redirected from a pipe  or\nfile.   This  file  is only present if the loginput or logstdin flags are set and\nthe standard input is not connected to a terminal.\n\nttyout    Output from the pseudo-terminal (what the command writes to the screen).  Terminal-\nspecific post-processing is performed before the data is logged.  This means  that,\nfor  example,  line  feeds are usually converted to line feed/carriage return pairs\nand tabs may be expanded to spaces.  This file is only present if the logoutput or\nlogttyout flags are set and sudo was run from a terminal.\n\nstdout    The standard output when no terminal is present, or output redirected to a pipe  or\nfile.   This file is only present if the logoutput or logstdout flags are set and\nthe standard output is not connected to a terminal.\n\nstderr    The standard error when no terminal is present, or output redirected to a  pipe  or\nfile.   This file is only present if the logoutput or logstderr flags are set and\nthe standard error is not connected to a terminal.\n\nAll files other than log are compressed in gzip format unless the compressio flag  has  been\ndisabled.  Due to buffering, it is not normally possible to display the I/O logs in real-time\nas  the program is executing.  The I/O log data will not be complete until the program run by\nsudo has exited or has been terminated by a signal.  The iologflush flag can be used to dis‐\nable buffering, in which case I/O log data is written to disk as soon  as  it  is  available.\nThe output portion of an I/O log file can be viewed with the sudoreplay(8) utility, which can\nalso be used to list or search the available logs.\n\nUser  input  may contain sensitive information such as passwords (even if they are not echoed\nto the screen), which will be stored in the log file unencrypted.  In most cases, logging the\ncommand output via logoutput or LOGOUTPUT is all that is  required.   When  logging  input,\nconsider disabling the logpasswords flag.\n\nSince  each  session's  I/O logs are stored in a separate directory, traditional log rotation\nutilities cannot be used to limit the number of I/O logs.  The simplest way to limit the num‐\nber of I/O is by setting the maxseq option to the maximum number of logs you wish  to  store.\nOnce  the  I/O  log sequence number reaches maxseq, it will be reset to zero and sudoers will\ntruncate and re-use any existing I/O logs.\n"
                }
            ]
        },
        "FILES": {
            "content": "/etc/sudo.conf            Sudo front-end configuration\n\n/etc/sudoers              List of who can run what\n\n/etc/group                Local groups file\n\n/etc/netgroup             List of network groups\n\n/var/log/sudo-io          I/O log files\n\n/run/sudo/ts              Directory containing time stamps for the sudoers security policy\n\n/var/lib/sudo/lectured    Directory containing lecture status files for the sudoers  security\npolicy\n\n/etc/environment          Initial environment for -i mode on AIX and Linux systems\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Below  are  example  sudoers  file  entries.   Admittedly, some of these are a bit contrived.\nFirst, we allow a few environment variables to pass and then define our aliases:\n\n# Run X applications through sudo; HOME is used to find the\n# .Xauthority file.  Other programs use HOME to locate configuration\n# files and this may lead to privilege escalation!\nDefaults envkeep += \"DISPLAY HOME\"\n\n# User alias specification\nUserAlias      FULLTIMERS = millert, mikef, dowdy\nUserAlias      PARTTIMERS = bostley, jwfox, crawl\nUserAlias      WEBADMIN = will, wendy, wim\n\n# Runas alias specification\nRunasAlias     OP = root, operator\nRunasAlias     DB = oracle, sybase\nRunasAlias     ADMINGRP = adm, oper\n\n# Host alias specification\nHostAlias      SPARC = bigtime, eclipse, moet, anchor :\\\nSGI = grolsch, dandelion, black :\\\nALPHA = widget, thalamus, foobar :\\\nHPPA = boa, nag, python\nHostAlias      CUNETS = 128.138.0.0/255.255.0.0\nHostAlias      CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0\nHostAlias      SERVERS = primary, mail, www, ns\nHostAlias      CDROM = orion, perseus, hercules\n\n# Cmnd alias specification\nCmndAlias      DUMPS = /usr/bin/mt, /usr/sbin/dump, /usr/sbin/rdump,\\\n/usr/sbin/restore, /usr/sbin/rrestore,\\\nsha224:0GomF8mNN3wlDt1HD9XldjJ3SNgpFdbjO1+NsQ== \\\n/home/operator/bin/startbackups\nCmndAlias      KILL = /usr/bin/kill\nCmndAlias      PRINTING = /usr/sbin/lpc, /usr/bin/lprm\nCmndAlias      SHUTDOWN = /usr/sbin/shutdown\nCmndAlias      HALT = /usr/sbin/halt\nCmndAlias      REBOOT = /usr/sbin/reboot\nCmndAlias      SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh,\\\n/usr/local/bin/tcsh, /usr/bin/rsh,\\\n/usr/local/bin/zsh\nCmndAlias      SU = /usr/bin/su\nCmndAlias      PAGERS = /usr/bin/more, /usr/bin/pg, /usr/bin/less\n\nHere we override some of the compiled in default values.  We want sudo to log  via  syslog(3)\nusing  the  auth facility in all cases and for commands to be run with the target user's home\ndirectory as the working directory.  We don't want to subject the full time staff to the sudo\nlecture and we want to allow them to run commands in a chroot(2) “sandbox” via the -R option.\nUser millert need not provide a password and we don't want to reset the LOGNAME or USER envi‐\nronment variables when running commands as  root.   Additionally,  on  the  machines  in  the\nSERVERS  HostAlias,  we  keep  an additional local log file and make sure we log the year in\neach log line since the log entries will be kept around for several years.  Lastly,  we  dis‐\nable  shell escapes for the commands in the PAGERS CmndAlias (/usr/bin/more, /usr/bin/pg and\n/usr/bin/less).  This will not effectively constrain users with sudo ALL privileges.\n\n# Override built-in defaults\nDefaults                syslog=auth,runcwd=~\nDefaults>root           !setlogname\nDefaults:FULLTIMERS     !lecture,runchroot=*\nDefaults:millert        !authenticate\nDefaults@SERVERS        logyear, logfile=/var/log/sudo.log\nDefaults!PAGERS         noexec\n\nThe User specification is the part that actually determines who may run what.\n\nroot            ALL = (ALL) ALL\n%wheel          ALL = (ALL) ALL\n\nWe let root and any user in group wheel run any command on any host as any user.\n\nFULLTIMERS      ALL = NOPASSWD: ALL\n\nFull time sysadmins (millert, mikef, and dowdy) may run any command on any host  without  au‐\nthenticating themselves.\n\nPARTTIMERS      ALL = ALL\n\nPart  time sysadmins bostley, jwfox, and crawl) may run any command on any host but they must\nauthenticate themselves first (since the entry lacks the NOPASSWD tag).\n\njack            CSNETS = ALL\n\nThe user jack may run any  command  on  the  machines  in  the  CSNETS  alias  (the  networks\n128.138.243.0,  128.138.204.0, and 128.138.242.0).  Of those networks, only 128.138.204.0 has\nan explicit netmask (in CIDR notation) indicating it is a class C  network.   For  the  other\nnetworks in CSNETS, the local machine's netmask will be used during matching.\n\nlisa            CUNETS = ALL\n\nThe  user  lisa  may  run  any  command  on any host in the CUNETS alias (the class B network\n128.138.0.0).\n\noperator        ALL = DUMPS, KILL, SHUTDOWN, HALT, REBOOT, PRINTING,\\\nsudoedit /etc/printcap, /usr/oper/bin/\n\nThe operator user may run commands limited to simple maintenance.  Here, those  are  commands\nrelated to backups, killing processes, the printing system, shutting down the system, and any\ncommands  in  the  directory  /usr/oper/bin/.  One command in the DUMPS CmndAlias includes a\nsha224 digest, /home/operator/bin/startbackups.  This is because  the  directory  containing\nthe  script  is writable by the operator user.  If the script is modified (resulting in a di‐\ngest mismatch) it will no longer be possible to run it via sudo.\n\njoe             ALL = /usr/bin/su operator\n\nThe user joe may only su(1) to operator.\n\npete            HPPA = /usr/bin/passwd [A-Za-z]*, !/usr/bin/passwd *root*\n\n%opers          ALL = (: ADMINGRP) /usr/sbin/\n\nUsers in the opers group may run commands in /usr/sbin/ as themselves with any group  in  the\nADMINGRP RunasAlias (the adm and oper groups).\n\nThe  user  pete  is allowed to change anyone's password except for root on the HPPA machines.\nBecause command line arguments are matched as a single, concatenated string, the ‘*’ wildcard\nwill match multiple words.  This example assumes that passwd(1) does not take  multiple  user\nnames on the command line.  On systems with GNU getopt(3), options to passwd(1) may be speci‐\nfied after the user argument.  As a result, this rule will also allow:\n\npasswd username --expire\n\nwhich may not be desirable.\n\nbob             SPARC = (OP) ALL : SGI = (OP) ALL\n\nThe  user  bob  may  run  anything on the SPARC and SGI machines as any user listed in the OP\nRunasAlias (root and operator.)\n\njim             +biglab = ALL\n\nThe user jim may run any command on  machines  in  the  biglab  netgroup.   sudo  knows  that\n“biglab” is a netgroup due to the ‘+’ prefix.\n\n+secretaries    ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser\n\nUsers  in the secretaries netgroup need to help manage the printers as well as add and remove\nusers, so they are allowed to run those commands on all machines.\n\nfred            ALL = (DB) NOPASSWD: ALL\n\nThe user fred can run commands as any user in the DB RunasAlias (oracle or  sybase)  without\ngiving a password.\n\njohn            ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*\n\nOn  the ALPHA machines, user john may su to anyone except root but he is not allowed to spec‐\nify any options to the su(1) command.\n\njen             ALL, !SERVERS = ALL\n\nThe user jen may run any command on any machine except for those in  the  SERVERS  HostAlias\n(primary, mail, www, and ns).\n\njill            SERVERS = /usr/bin/, !SU, !SHELLS\n\nFor  any  machine  in  the  SERVERS  HostAlias,  jill  may run any commands in the directory\n/usr/bin/ except for those commands belonging to the SU and SHELLS CmndAliases.   While  not\nspecifically  mentioned  in  the  rule,  the  commands in the PAGERS CmndAlias all reside in\n/usr/bin and have the noexec option set.\n\nsteve           CSNETS = (operator) /usr/local/opcommands/\n\nThe user steve may run any command in the directory /usr/local/opcommands/ but only as  user\noperator.\n\nmatt            valkyrie = KILL\n\nOn his personal workstation, valkyrie, matt needs to be able to kill hung processes.\n\nWEBADMIN        www = (www) ALL, (root) /usr/bin/su www\n\nOn the host www, any user in the WEBADMIN UserAlias (will, wendy, and wim), may run any com‐\nmand as user www (which owns the web pages) or simply su(1) to www.\n\nALL             CDROM = NOPASSWD: /sbin/umount /CDROM,\\\n/sbin/mount -o nosuid\\,nodev /dev/cd0a /CDROM\n\nAny  user  may  mount  or  unmount  a  CD-ROM on the machines in the CDROM HostAlias (orion,\nperseus, hercules) without entering a password.  This is a bit tedious for users to type,  so\nit is a prime candidate for encapsulating in a shell script.\n",
            "subsections": []
        },
        "SECURITY NOTES": {
            "content": "Limitations of the ‘!’ operator\nIt is generally not effective to “subtract” commands from ALL using the ‘!’ operator.  A user\ncan trivially circumvent this by copying the desired command to a different name and then ex‐\necuting that.  For example:\n\nbill    ALL = ALL, !SU, !SHELLS\n\nDoesn't  really  prevent  bill  from running the commands listed in SU or SHELLS since he can\nsimply copy those commands to a different name, or use a shell escape from an editor or other\nprogram.  Therefore, these kind of restrictions should be considered advisory  at  best  (and\nreinforced by policy).\n\nIn  general,  if a user has sudo ALL there is nothing to prevent them from creating their own\nprogram that gives them a root shell (or making their own copy of a shell) regardless of  any\n‘!’ elements in the user specification.\n",
            "subsections": [
                {
                    "name": "Security implications of fast_glob",
                    "content": "If  the  fastglob option is in use, it is not possible to reliably negate commands where the\npath name includes globbing (aka wildcard) characters.   This  is  because  the  C  library's\nfnmatch(3)  function cannot resolve relative paths.  While this is typically only an inconve‐\nnience for rules that grant privileges, it can result in a security issue for rules that sub‐\ntract or revoke privileges.\n\nFor example, given the following sudoers file entry:\n\njohn    ALL = /usr/bin/passwd [a-zA-Z0-9]*, /usr/bin/chsh [a-zA-Z0-9]*,\\\n/usr/bin/chfn [a-zA-Z0-9]*, !/usr/bin/* root\n\nUser john can still run ‘/usr/bin/passwd  root’  if  fastglob  is  enabled  by  changing  to\n/usr/bin and running ‘./passwd root’ instead.\n\nAnother  potential  issue  is that when sudo executes the command, it must use the command or\npath specified by the user instead of a path listed in the sudoers file.  This may lead to  a\ntime of check versus time of use race condition.\n"
                },
                {
                    "name": "Wildcards in command arguments",
                    "content": "Command  line  arguments  are matched as a single, concatenated string.  This mean a wildcard\ncharacter such as ‘?’ or ‘*’ will match across word boundaries, which may be unexpected.  For\nexample, while a sudoers entry like:\n\n%operator ALL = /bin/cat /var/log/messages*\n\nwill allow command like:\n\n$ sudo cat /var/log/messages.1\n\nIt will also allow:\n\n$ sudo cat /var/log/messages /etc/shadow\n\nwhich is probably not what was intended.  A safer alternative is to use a regular  expression\nfor matching command line arguments.  The above example can be rewritten as a regular expres‐\nsion:\n\n%operator ALL = /bin/cat ^/var/log/messages[^[:space:]]*$\n\nThe  regular  expression  will  only  match  a  single  file  with  a  name  that begins with\n/var/log/messages and does not include any white space in the name.  It is often better to do\ncommand line processing outside of the sudoers file in a scripting language for anything non-\ntrivial.\n"
                },
                {
                    "name": "Regular expressions in command names",
                    "content": "Using a regular expression to match a command name has the same security implications as  us‐\ning the fastglob option:\n\n•  It is not possible to reliably negate commands when the path name is a regular expression.\n\n•  When  sudo executes the command, it must use the command or path specified by the user in‐\nstead of a path listed in the sudoers file.  This may lead to a time of check versus  time\nof use race condition.\n\nThese  issues  do  not apply to rules where only the command line options are matched using a\nregular expression.\n"
                },
                {
                    "name": "Preventing shell escapes",
                    "content": "Once sudo executes a program, that program is free to do whatever it pleases,  including  run\nother programs.  This can be a security issue since it is not uncommon for a program to allow\nshell  escapes,  which lets a user bypass sudo's access control and logging.  Common programs\nthat permit shell escapes include shells (obviously), editors, paginators, mail, and terminal\nprograms.\n\nThere are four basic approaches to this problem:\n\nrestrict   Avoid giving users access to commands that allow the user to  run  arbitrary  com‐\nmands.   Many  editors  have  a  restricted mode where shell escapes are disabled,\nthough sudoedit is a better solution to running editors  via  sudo.   Due  to  the\nlarge number of programs that offer shell escapes, restricting users to the set of\nprograms that do not is often unworkable.\n\nintercept  On  most  systems, sudo's intercept functionality can be used to transparently in‐\ntercept an attempt to run a new command, allow or deny it based on sudoers  rules,\nand  log  the  result.  For example, this can be used to restrict the commands run\nfrom within a privileged shell or editor.  However, not all programs operate  cor‐\nrectly when intercept is enabled.\n\nThere  are two underlying mechanisms that may be used to implement intercept mode:\ndso and trace.  The intercepttype setting can be used to select between them.\n\nThe first mechanism, dso, overrides the standard C library functions that are used\nto execute a command.  It does this by setting an  environment  variable  (usually\nLDPRELOAD)  to the path of a dynamic shared object, or shared library, containing\ncustom versions  of  the  execve(2),  execl(3),  execle(3),  execlp(3),  execv(3),\nexecvp(3),  execvpe(3),  and system(3) library functions that connect back to sudo\nfor a policy decision.  Note, however, that  this  applies  only  to  dynamically-\nlinked  executables.   It  is  not  possible to intercept commands for statically-\nlinked executables or executables that run under binary emulation this  way.   Be‐\ncause most dynamic loaders ignore LDPRELOAD (or the equivalent) when running set-\nuser-ID and set-group-ID programs, sudoers will not permit such programs to be run\nin  intercept  mode  by  default.   The  dso mechanism is incompatible with sudo's\nSELinux RBAC support (but see below).  SELinux disables LDPRELOAD by default  and\ninterferes with file descriptor inheritance, which sudo relies on.\n\nThe second mechanism, trace, is available on Linux systems that support seccomp(2)\nfiltering.   It  uses  ptrace(2)  and seccomp(2) to intercept the execve(2) system\ncall instead of pre-loading a dynamic shared object.  Both static and dynamic exe‐\ncutables are supported and it is compatible with sudo's SELinux RBAC mode.   Func‐\ntions utilizing the execveat(2) system call, such as fexecve(3), are not currently\nintercepted.   Programs  that  rely on ptrace(2) themselves, such as debuggers and\nsystem call tracers (such as strace(1) and truss(1)) will be unable to function if\nintercept is enabled  in  trace  mode.   This  same  restriction  applies  to  the\nlogsubcmds sudoers option.\n\nThe  intercept feature is known to work on Solaris, *BSD, Linux, macOS, HP-UX 11.x\nand AIX 5.3 and above.  It should be supported on most operating systems that sup‐\nport the LDPRELOAD environment variable or an equivalent.  It is not possible  to\nintercept  shell built-in commands or restrict the ability to read or write sensi‐\ntive files from within a shell.\n\nTo enable intercept mode on a per-command basis, use the INTERCEPT  tag  as  docu‐\nmented in the User Specification section above.  Here is that example again:\n\nchuck   research = INTERCEPT: ALL\n\nThis  allows  user chuck to run any command on the machine “research” in intercept\nmode.  Any commands run via shell escapes will be validated and  logged  by  sudo.\nIf  you  are unsure whether or not your system is capable of supporting intercept,\nyou can always just try it out and check whether or not external commands run  via\na shell are logged when intercept is enabled.\n\nThere  is  an  inherent  race  condition between when a command is checked against\nsudoers rules and when it is actually executed.  If a user is allowed to run arbi‐\ntrary commands, they may be able to change the execve(2) arguments in the  program\nafter  the  sudoers  policy check has completed but before the new command is exe‐\ncuted.  Starting with version 1.9.12, the trace method will verify that  the  com‐\nmand  and  its arguments have not changed after execve(2) has completed but before\nexecution of the new program has had a chance to run.  This is not the  case  with\nthe  dso method.  See the description of the interceptverify setting for more in‐\nformation.\n\nlog        There are two separate but related ways to log additional commands.  The first  is\nto enable I/O logging using the logoutput flag.  This will log the command's out‐\nput  but  will  not  create an event log entry when the additional command is run.\nThe second is to enable the logsubcmds flag in sudoers which will create an event\nlog entry every time a new command is run.  If I/O logging is  also  enabled,  the\nlog entry will include a time offset into the I/O log to indicate when the command\nwas run.  This offset can be passed to the sudoreplay(8) utility to replay the I/O\nlog  at  the exact moment when the command was run.  The logsubcmds flag uses the\nsame mechanism as intercept (see above) and has the same limitations.\n\nnoexec     sudo's noexec functionality can be used to prevent a program run by sudo from exe‐\ncuting any other programs.  On most systems, it uses the same LDPRELOAD mechanism\nas intercept (see above) and thus the same caveats apply.  The noexec  functional‐\nity  is capable of blocking execution of commands run via the execve(2), execl(3),\nexecle(3),  execlp(3),  exect(3),  execv(3),  execveat(3),  execvP(3),  execvp(3),\nexecvpe(3),  fexecve(3), popen(3), posixspawn(3), posixspawnp(3), system(3), and\nwordexp(3) functions.  On Linux, a seccomp(2) filter is used to implement  noexec.\nOn Solaris 10 and higher, noexec uses Solaris privileges instead of the LDPRELOAD\nenvironment variable.\n\nTo enable noexec for a command, use the NOEXEC tag as documented in the User Spec‐\nification section above.  Here is that example again:\n\naaron   shanty = NOEXEC: /usr/bin/more, /usr/bin/vi\n\nThis  allows  user aaron to run /usr/bin/more and /usr/bin/vi with noexec enabled.\nThis will prevent those two commands from executing  other  commands  (such  as  a\nshell).   If  you  are  unsure whether or not your system is capable of supporting\nnoexec you can always just try it out and check whether shell  escapes  work  when\nnoexec is enabled.\n\nRestricting  shell  escapes  is not a panacea.  Programs running as root are still capable of\nmany potentially hazardous operations (such as changing or overwriting files) that could lead\nto unintended privilege escalation.  In the specific case of an editor, a safer  approach  is\nto give the user permission to run sudoedit (see below).\n"
                },
                {
                    "name": "Secure editing",
                    "content": "The  sudoers  plugin includes sudoedit support which allows users to securely edit files with\nthe editor of their choice.  As sudoedit is a built-in command, it must be specified  in  the\nsudoers  file  without a leading path.  However, it may take command line arguments just as a\nnormal command does.  Wildcards used in sudoedit command line arguments are  expected  to  be\npath names, so a forward slash (‘/’) will not be matched by a wildcard.\n\nUnlike  other  sudo commands, the editor is run with the permissions of the invoking user and\nwith the environment unmodified.  More information may be found in the description of the  -e\noption in sudo(8).\n\nFor example, to allow user operator to edit the “message of the day” file on any machine:\n\noperator ALL = sudoedit /etc/motd\n\nThe operator user then runs sudoedit as follows:\n\n$ sudoedit /etc/motd\n\nThe  editor will run as the operator user, not root, on a temporary copy of /etc/motd.  After\nthe file has been edited, /etc/motd will be updated with the contents of the temporary copy.\n\nUsers should never be granted sudoedit permission to edit a file that resides in a  directory\nthe  user  has write access to, either directly or via a wildcard.  If the user has write ac‐\ncess to the directory it is possible to replace the legitimate file with a  link  to  another\nfile,  allowing  the  editing  of  arbitrary  files.   To prevent this, starting with version\n1.8.16, symbolic links will not be followed in writable directories and sudoedit will  refuse\nto  edit  a file located in a writable directory unless the sudoeditcheckdir option has been\ndisabled or the invoking user is root.  Additionally, in version 1.8.15 and higher,  sudoedit\nwill  refuse  to  open a symbolic link unless either the sudoeditfollow option is enabled or\nthe sudoedit command is prefixed with the FOLLOW tag in the sudoers file.\n"
                },
                {
                    "name": "Time stamp file checks",
                    "content": "sudoers will check the ownership of its time stamp directory (/run/sudo/ts  by  default)  and\nignore  the  directory's  contents  if it is not owned by root or if it is writable by a user\nother than root.  Older versions of sudo stored time stamp files in /tmp; this is  no  longer\nrecommended  as  it may be possible for a user to create the time stamp themselves on systems\nthat allow unprivileged users to change the ownership of files they create.\n\nWhile the time stamp directory should be cleared at reboot time, not all  systems  contain  a\n/run  or  /var/run  directory.   To  avoid potential problems, sudoers will ignore time stamp\nfiles that date from before the machine booted on systems where the boot time is available.\n\nSome systems with graphical desktop environments allow unprivileged users to change the  sys‐\ntem  clock.   Since  sudoers  relies on the system clock for time stamp validation, it may be\npossible on such systems for a user to run sudo for longer than timestamptimeout by  setting\nthe clock back.  To combat this, sudoers uses a monotonic clock (which never moves backwards)\nfor its time stamps if the system supports it.\n\nsudoers  will  not  honor time stamps set far in the future.  Time stamps with a date greater\nthan currenttime + 2 * TIMEOUT will be ignored and sudoers will log and complain.\n\nIf the timestamptype option is set to “tty”, the time stamp record includes the device  num‐\nber  of the terminal the user authenticated with.  This provides per-terminal granularity but\ntime stamp records may still outlive the user's session.\n\nUnless the timestamptype option is set to “global”, the time stamp record also includes  the\nsession ID of the process that last authenticated.  This prevents processes in different ter‐\nminal  sessions  from  using  the same time stamp record.  On systems where a process's start\ntime can be queried, the start time of the session leader  is  recorded  in  the  time  stamp\nrecord.   If  no terminal is present or the timestamptype option is set to “ppid”, the start\ntime of the parent process is used instead.  In most cases this will  prevent  a  time  stamp\nrecord  from  being re-used without the user entering a password when logging out and back in\nagain.\n"
                }
            ]
        },
        "DEBUGGING": {
            "content": "Versions 1.8.4 and higher of the sudoers plugin support a flexible debugging  framework  that\ncan  help  track down what the plugin is doing internally if there is a problem.  This can be\nconfigured in the sudo.conf(5) file.\n\nThe sudoers plugin uses the same debug flag format as the sudo front-end: subsystem@priority.\n\nThe priorities used by sudoers, in order  of  decreasing  severity,  are:  crit,  err,  warn,\nnotice,  diag, info, trace, and debug.  Each priority, when specified, also includes all pri‐\norities higher than it.  For example, a priority  of  notice  would  include  debug  messages\nlogged at notice and higher.\n\nThe following subsystems are used by the sudoers plugin:\n\nalias     UserAlias, RunasAlias, HostAlias and CmndAlias processing\n\nall       matches every subsystem\n\naudit     BSM and Linux audit code\n\nauth      user authentication\n\ndefaults  sudoers file Defaults settings\n\nenv       environment handling\n\nldap      LDAP-based sudoers\n\nlogging   logging support\n\nmatch     matching of users, groups, hosts, and netgroups in the sudoers file\n\nnetif     network interface handling\n\nnss       network service switch handling in sudoers\n\nparser    sudoers file parsing\n\nperms     permission setting\n\nplugin    The equivalent of main for the plugin.\n\npty       pseudo-terminal related code\n\nrbtree    redblack tree internals\n\nsssd      SSSD-based sudoers\n\nutil      utility functions\n\nFor example:\n\nDebug sudoers.so /var/log/sudoersdebug match@info,nss@info\n\nFor more information, see the sudo.conf(5) manual.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ssh(1),  su(1),  fnmatch(3),  glob(3),  mktemp(3), strftime(3), sudo.conf(5), sudoplugin(5),\nsudoers.ldap(5), sudoerstimestamp(5), sudo(8), visudo(8)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Many people have worked on sudo over the years; this version consists of code written primar‐\nily by:\n\nTodd C. Miller\n\nSee the CONTRIBUTORS.md file in the  sudo  distribution  (https://www.sudo.ws/about/contribu‐\ntors/) for an exhaustive list of people who have contributed to sudo.\n",
            "subsections": []
        },
        "CAVEATS": {
            "content": "The  sudoers  file  should  always  be  edited by the visudo utility which locks the file and\nchecks for syntax errors.  If sudoers contains syntax errors, sudo may refuse to  run,  which\nis  a  serious problem if sudo is your only method of obtaining superuser privileges.  Recent\nversions of sudoers will attempt to recover after a syntax error by ignoring the rest of  the\nline  after encountering an error.  Older versions of sudo will not run if sudoers contains a\nsyntax error.\n\nWhen using netgroups of machines (as opposed to users), if you  store  fully  qualified  host\nname  in  the  netgroup  (as is usually the case), you either need to have the machine's host\nname be fully qualified as returned by the  hostname  command  or  use  the  fqdn  option  in\nsudoers.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "If   you   believe  you  have  found  a  bug  in  sudo,  you  can  submit  a  bug  report  at\nhttps://bugzilla.sudo.ws/\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Limited   free   support   is   available   via   the   sudo-users    mailing    list,    see\nhttps://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search the archives.\n",
            "subsections": []
        },
        "DISCLAIMER": {
            "content": "sudo  is  provided  “AS IS” and any express or implied warranties, including, but not limited\nto, the implied warranties of merchantability and fitness for a particular purpose  are  dis‐\nclaimed.  See the LICENSE.md file distributed with sudo or https://www.sudo.ws/about/license/\nfor complete details.\n\nSudo 1.9.15p5                             December 19, 2023                               SUDOERS(5)",
            "subsections": []
        }
    },
    "summary": "sudoers — default sudo security policy plugin",
    "flags": [],
    "examples": [
        "Below  are  example  sudoers  file  entries.   Admittedly, some of these are a bit contrived.",
        "First, we allow a few environment variables to pass and then define our aliases:",
        "# Run X applications through sudo; HOME is used to find the",
        "# .Xauthority file.  Other programs use HOME to locate configuration",
        "# files and this may lead to privilege escalation!",
        "Defaults envkeep += \"DISPLAY HOME\"",
        "# User alias specification",
        "UserAlias      FULLTIMERS = millert, mikef, dowdy",
        "UserAlias      PARTTIMERS = bostley, jwfox, crawl",
        "UserAlias      WEBADMIN = will, wendy, wim",
        "# Runas alias specification",
        "RunasAlias     OP = root, operator",
        "RunasAlias     DB = oracle, sybase",
        "RunasAlias     ADMINGRP = adm, oper",
        "# Host alias specification",
        "HostAlias      SPARC = bigtime, eclipse, moet, anchor :\\",
        "SGI = grolsch, dandelion, black :\\",
        "ALPHA = widget, thalamus, foobar :\\",
        "HPPA = boa, nag, python",
        "HostAlias      CUNETS = 128.138.0.0/255.255.0.0",
        "HostAlias      CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0",
        "HostAlias      SERVERS = primary, mail, www, ns",
        "HostAlias      CDROM = orion, perseus, hercules",
        "# Cmnd alias specification",
        "CmndAlias      DUMPS = /usr/bin/mt, /usr/sbin/dump, /usr/sbin/rdump,\\",
        "/usr/sbin/restore, /usr/sbin/rrestore,\\",
        "sha224:0GomF8mNN3wlDt1HD9XldjJ3SNgpFdbjO1+NsQ== \\",
        "/home/operator/bin/startbackups",
        "CmndAlias      KILL = /usr/bin/kill",
        "CmndAlias      PRINTING = /usr/sbin/lpc, /usr/bin/lprm",
        "CmndAlias      SHUTDOWN = /usr/sbin/shutdown",
        "CmndAlias      HALT = /usr/sbin/halt",
        "CmndAlias      REBOOT = /usr/sbin/reboot",
        "CmndAlias      SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh,\\",
        "/usr/local/bin/tcsh, /usr/bin/rsh,\\",
        "/usr/local/bin/zsh",
        "CmndAlias      SU = /usr/bin/su",
        "CmndAlias      PAGERS = /usr/bin/more, /usr/bin/pg, /usr/bin/less",
        "Here we override some of the compiled in default values.  We want sudo to log  via  syslog(3)",
        "using  the  auth facility in all cases and for commands to be run with the target user's home",
        "directory as the working directory.  We don't want to subject the full time staff to the sudo",
        "lecture and we want to allow them to run commands in a chroot(2) “sandbox” via the -R option.",
        "User millert need not provide a password and we don't want to reset the LOGNAME or USER envi‐",
        "ronment variables when running commands as  root.   Additionally,  on  the  machines  in  the",
        "SERVERS  HostAlias,  we  keep  an additional local log file and make sure we log the year in",
        "each log line since the log entries will be kept around for several years.  Lastly,  we  dis‐",
        "able  shell escapes for the commands in the PAGERS CmndAlias (/usr/bin/more, /usr/bin/pg and",
        "/usr/bin/less).  This will not effectively constrain users with sudo ALL privileges.",
        "# Override built-in defaults",
        "Defaults                syslog=auth,runcwd=~",
        "Defaults>root           !setlogname",
        "Defaults:FULLTIMERS     !lecture,runchroot=*",
        "Defaults:millert        !authenticate",
        "Defaults@SERVERS        logyear, logfile=/var/log/sudo.log",
        "Defaults!PAGERS         noexec",
        "The User specification is the part that actually determines who may run what.",
        "root            ALL = (ALL) ALL",
        "%wheel          ALL = (ALL) ALL",
        "We let root and any user in group wheel run any command on any host as any user.",
        "FULLTIMERS      ALL = NOPASSWD: ALL",
        "Full time sysadmins (millert, mikef, and dowdy) may run any command on any host  without  au‐",
        "thenticating themselves.",
        "PARTTIMERS      ALL = ALL",
        "Part  time sysadmins bostley, jwfox, and crawl) may run any command on any host but they must",
        "authenticate themselves first (since the entry lacks the NOPASSWD tag).",
        "jack            CSNETS = ALL",
        "The user jack may run any  command  on  the  machines  in  the  CSNETS  alias  (the  networks",
        "128.138.243.0,  128.138.204.0, and 128.138.242.0).  Of those networks, only 128.138.204.0 has",
        "an explicit netmask (in CIDR notation) indicating it is a class C  network.   For  the  other",
        "networks in CSNETS, the local machine's netmask will be used during matching.",
        "lisa            CUNETS = ALL",
        "The  user  lisa  may  run  any  command  on any host in the CUNETS alias (the class B network",
        "128.138.0.0).",
        "operator        ALL = DUMPS, KILL, SHUTDOWN, HALT, REBOOT, PRINTING,\\",
        "sudoedit /etc/printcap, /usr/oper/bin/",
        "The operator user may run commands limited to simple maintenance.  Here, those  are  commands",
        "related to backups, killing processes, the printing system, shutting down the system, and any",
        "commands  in  the  directory  /usr/oper/bin/.  One command in the DUMPS CmndAlias includes a",
        "sha224 digest, /home/operator/bin/startbackups.  This is because  the  directory  containing",
        "the  script  is writable by the operator user.  If the script is modified (resulting in a di‐",
        "gest mismatch) it will no longer be possible to run it via sudo.",
        "joe             ALL = /usr/bin/su operator",
        "The user joe may only su(1) to operator.",
        "pete            HPPA = /usr/bin/passwd [A-Za-z]*, !/usr/bin/passwd *root*",
        "%opers          ALL = (: ADMINGRP) /usr/sbin/",
        "Users in the opers group may run commands in /usr/sbin/ as themselves with any group  in  the",
        "ADMINGRP RunasAlias (the adm and oper groups).",
        "The  user  pete  is allowed to change anyone's password except for root on the HPPA machines.",
        "Because command line arguments are matched as a single, concatenated string, the ‘*’ wildcard",
        "will match multiple words.  This example assumes that passwd(1) does not take  multiple  user",
        "names on the command line.  On systems with GNU getopt(3), options to passwd(1) may be speci‐",
        "fied after the user argument.  As a result, this rule will also allow:",
        "passwd username --expire",
        "which may not be desirable.",
        "bob             SPARC = (OP) ALL : SGI = (OP) ALL",
        "The  user  bob  may  run  anything on the SPARC and SGI machines as any user listed in the OP",
        "RunasAlias (root and operator.)",
        "jim             +biglab = ALL",
        "The user jim may run any command on  machines  in  the  biglab  netgroup.   sudo  knows  that",
        "“biglab” is a netgroup due to the ‘+’ prefix.",
        "+secretaries    ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser",
        "Users  in the secretaries netgroup need to help manage the printers as well as add and remove",
        "users, so they are allowed to run those commands on all machines.",
        "fred            ALL = (DB) NOPASSWD: ALL",
        "The user fred can run commands as any user in the DB RunasAlias (oracle or  sybase)  without",
        "giving a password.",
        "john            ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*",
        "On  the ALPHA machines, user john may su to anyone except root but he is not allowed to spec‐",
        "ify any options to the su(1) command.",
        "jen             ALL, !SERVERS = ALL",
        "The user jen may run any command on any machine except for those in  the  SERVERS  HostAlias",
        "(primary, mail, www, and ns).",
        "jill            SERVERS = /usr/bin/, !SU, !SHELLS",
        "For  any  machine  in  the  SERVERS  HostAlias,  jill  may run any commands in the directory",
        "/usr/bin/ except for those commands belonging to the SU and SHELLS CmndAliases.   While  not",
        "specifically  mentioned  in  the  rule,  the  commands in the PAGERS CmndAlias all reside in",
        "/usr/bin and have the noexec option set.",
        "steve           CSNETS = (operator) /usr/local/opcommands/",
        "The user steve may run any command in the directory /usr/local/opcommands/ but only as  user",
        "operator.",
        "matt            valkyrie = KILL",
        "On his personal workstation, valkyrie, matt needs to be able to kill hung processes.",
        "WEBADMIN        www = (www) ALL, (root) /usr/bin/su www",
        "On the host www, any user in the WEBADMIN UserAlias (will, wendy, and wim), may run any com‐",
        "mand as user www (which owns the web pages) or simply su(1) to www.",
        "ALL             CDROM = NOPASSWD: /sbin/umount /CDROM,\\",
        "/sbin/mount -o nosuid\\,nodev /dev/cd0a /CDROM",
        "Any  user  may  mount  or  unmount  a  CD-ROM on the machines in the CDROM HostAlias (orion,",
        "perseus, hercules) without entering a password.  This is a bit tedious for users to type,  so",
        "it is a prime candidate for encapsulating in a shell script."
    ],
    "see_also": [
        {
            "name": "ssh",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ssh/1/json"
        },
        {
            "name": "su",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/su/1/json"
        },
        {
            "name": "fnmatch",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/fnmatch/3/json"
        },
        {
            "name": "glob",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/glob/3/json"
        },
        {
            "name": "mktemp",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/mktemp/3/json"
        },
        {
            "name": "strftime",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/strftime/3/json"
        },
        {
            "name": "sudo.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/sudo.conf/5/json"
        },
        {
            "name": "sudoplugin",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/sudoplugin/5/json"
        },
        {
            "name": "sudoers.ldap",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/sudoers.ldap/5/json"
        },
        {
            "name": "sudoerstimestamp",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/sudoerstimestamp/5/json"
        },
        {
            "name": "sudo",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sudo/8/json"
        },
        {
            "name": "visudo",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/visudo/8/json"
        }
    ]
}