1SUDO(8)                   BSD System Manager's Manual                  SUDO(8)
2

NAME

4     sudo, sudoedit — execute a command as another user
5

SYNOPSIS

7     sudo -h | -K | -k | -V
8     sudo -v [-ABknS] [-g group] [-h host] [-p prompt] [-u user]
9     sudo -l [-ABknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
10          [command]
11     sudo [-ABbEHnPS] [-C num] [-g group] [-h host] [-p prompt] [-r role]
12          [-t type] [-T timeout] [-u user] [VAR=value] [-i | -s] [command]
13     sudoedit [-ABknS] [-C num] [-g group] [-h host] [-p prompt] [-T timeout]
14          [-u user] file ...
15

DESCRIPTION

17     sudo allows a permitted user to execute a command as the superuser or
18     another user, as specified by the security policy.  The invoking user's
19     real (not effective) user-ID is used to determine the user name with
20     which to query the security policy.
21
22     sudo supports a plugin architecture for security policies and input/out‐
23     put logging.  Third parties can develop and distribute their own policy
24     and I/O logging plugins to work seamlessly with the sudo front end.  The
25     default security policy is sudoers, which is configured via the file
26     /etc/sudoers, or via LDAP.  See the Plugins section for more information.
27
28     The security policy determines what privileges, if any, a user has to run
29     sudo.  The policy may require that users authenticate themselves with a
30     password or another authentication mechanism.  If authentication is
31     required, sudo will exit if the user's password is not entered within a
32     configurable time limit.  This limit is policy-specific; the default
33     password prompt timeout for the sudoers security policy is 5 minutes.
34
35     Security policies may support credential caching to allow the user to run
36     sudo again for a period of time without requiring authentication.  By
37     default, the sudoers policy caches credentials on a per-terminal basis
38     for 5 minutes.  See the timestamp_type and timestamp_timeout options in
39     sudoers(5) for more information.  By running sudo with the -v option, a
40     user can update the cached credentials without running a command.
41
42     When invoked as sudoedit, the -e option (described below), is implied.
43
44     Security policies may log successful and failed attempts to use sudo.  If
45     an I/O plugin is configured, the running command's input and output may
46     be logged as well.
47
48     The options are as follows:
49
50     -A, --askpass
51                 Normally, if sudo requires a password, it will read it from
52                 the user's terminal.  If the -A (askpass) option is speci‐
53                 fied, a (possibly graphical) helper program is executed to
54                 read the user's password and output the password to the stan‐
55                 dard output.  If the SUDO_ASKPASS environment variable is
56                 set, it specifies the path to the helper program.  Otherwise,
57                 if sudo.conf(5) contains a line specifying the askpass pro‐
58                 gram, that value will be used.  For example:
59
60                     # Path to askpass helper program
61                     Path askpass /usr/X11R6/bin/ssh-askpass
62
63                 If no askpass program is available, sudo will exit with an
64                 error.
65
66     -B, --bell  Ring the bell as part of the password promp when a terminal
67                 is present.  This option has no effect if an askpass program
68                 is used.
69
70     -b, --background
71                 Run the given command in the background.  Note that it is not
72                 possible to use shell job control to manipulate background
73                 processes started by sudo.  Most interactive commands will
74                 fail to work properly in background mode.
75
76     -C num, --close-from=num
77                 Close all file descriptors greater than or equal to num
78                 before executing a command.  Values less than three are not
79                 permitted.  By default, sudo will close all open file
80                 descriptors other than standard input, standard output and
81                 standard error when executing a command.  The security policy
82                 may restrict the user's ability to use this option.  The
83                 sudoers policy only permits use of the -C option when the
84                 administrator has enabled the closefrom_override option.
85
86     -E, --preserve-env
87                 Indicates to the security policy that the user wishes to pre‐
88                 serve their existing environment variables.  The security
89                 policy may return an error if the user does not have permis‐
90                 sion to preserve the environment.
91
92     --preserve-env=list
93                 Indicates to the security policy that the user wishes to add
94                 the comma-separated list of environment variables to those
95                 preserved from the user's environment.  The security policy
96                 may return an error if the user does not have permission to
97                 preserve the environment.
98
99     -e, --edit  Edit one or more files instead of running a command.  In lieu
100                 of a path name, the string "sudoedit" is used when consulting
101                 the security policy.  If the user is authorized by the pol‐
102                 icy, the following steps are taken:
103
104                 1.   Temporary copies are made of the files to be edited with
105                      the owner set to the invoking user.
106
107                 2.   The editor specified by the policy is run to edit the
108                      temporary files.  The sudoers policy uses the
109                      SUDO_EDITOR, VISUAL and EDITOR environment variables (in
110                      that order).  If none of SUDO_EDITOR, VISUAL or EDITOR
111                      are set, the first program listed in the editor
112                      sudoers(5) option is used.
113
114                 3.   If they have been modified, the temporary files are
115                      copied back to their original location and the temporary
116                      versions are removed.
117
118                 To help prevent the editing of unauthorized files, the fol‐
119                 lowing restrictions are enforced unless explicitly allowed by
120                 the security policy:
121
122                 ·  Symbolic links may not be edited (version 1.8.15 and
123                    higher).
124
125                 ·  Symbolic links along the path to be edited are not fol‐
126                    lowed when the parent directory is writable by the invok‐
127                    ing user unless that user is root (version 1.8.16 and
128                    higher).
129
130                 ·  Files located in a directory that is writable by the
131                    invoking user may not be edited unless that user is root
132                    (version 1.8.16 and higher).
133
134                 Users are never allowed to edit device special files.
135
136                 If the specified file does not exist, it will be created.
137                 Note that unlike most commands run by sudo, the editor is run
138                 with the invoking user's environment unmodified.  If, for
139                 some reason, sudo is unable to update a file with its edited
140                 version, the user will receive a warning and the edited copy
141                 will remain in a temporary file.
142
143     -g group, --group=group
144                 Run the command with the primary group set to group instead
145                 of the primary group specified by the target user's password
146                 database entry.  The group may be either a group name or a
147                 numeric group-ID (GID) prefixed with the ‘#’ character (e.g.,
148                 #0 for GID 0).  When running a command as a GID, many shells
149                 require that the ‘#’ be escaped with a backslash (‘\’).  If
150                 no -u option is specified, the command will be run as the
151                 invoking user.  In either case, the primary group will be set
152                 to group.  The sudoers policy permits any of the target
153                 user's groups to be specified via the -g option as long as
154                 the -P option is not in use.
155
156     -H, --set-home
157                 Request that the security policy set the HOME environment
158                 variable to the home directory specified by the target user's
159                 password database entry.  Depending on the policy, this may
160                 be the default behavior.
161
162     -h, --help  Display a short help message to the standard output and exit.
163
164     -h host, --host=host
165                 Run the command on the specified host if the security policy
166                 plugin supports remote commands.  Note that the sudoers plug‐
167                 in does not currently support running remote commands.  This
168                 may also be used in conjunction with the -l option to list a
169                 user's privileges for the remote host.
170
171     -i, --login
172                 Run the shell specified by the target user's password data‐
173                 base entry as a login shell.  This means that login-specific
174                 resource files such as .profile, .bash_profile or .login will
175                 be read by the shell.  If a command is specified, it is
176                 passed to the shell for execution via the shell's -c option.
177                 If no command is specified, an interactive shell is executed.
178                 sudo attempts to change to that user's home directory before
179                 running the shell.  The command is run with an environment
180                 similar to the one a user would receive at log in.  Note that
181                 most shells behave differently when a command is specified as
182                 compared to an interactive session; consult the shell's man‐
183                 ual for details.  The Command environment section in the
184                 sudoers(5) manual documents how the -i option affects the
185                 environment in which a command is run when the sudoers policy
186                 is in use.
187
188     -K, --remove-timestamp
189                 Similar to the -k option, except that it removes the user's
190                 cached credentials entirely and may not be used in conjunc‐
191                 tion with a command or other option.  This option does not
192                 require a password.  Not all security policies support cre‐
193                 dential caching.
194
195     -k, --reset-timestamp
196                 When used without a command, invalidates the user's cached
197                 credentials.  In other words, the next time sudo is run a
198                 password will be required.  This option does not require a
199                 password and was added to allow a user to revoke sudo permis‐
200                 sions from a .logout file.
201
202                 When used in conjunction with a command or an option that may
203                 require a password, this option will cause sudo to ignore the
204                 user's cached credentials.  As a result, sudo will prompt for
205                 a password (if one is required by the security policy) and
206                 will not update the user's cached credentials.
207
208                 Not all security policies support credential caching.
209
210     -l, --list  If no command is specified, list the allowed (and forbidden)
211                 commands for the invoking user (or the user specified by the
212                 -U option) on the current host.  A longer list format is used
213                 if this option is specified multiple times and the security
214                 policy supports a verbose output format.
215
216                 If a command is specified and is permitted by the security
217                 policy, the fully-qualified path to the command is displayed
218                 along with any command line arguments.  If a command is spec‐
219                 ified but not allowed by the policy, sudo will exit with a
220                 status value of 1.
221
222     -n, --non-interactive
223                 Avoid prompting the user for input of any kind.  If a pass‐
224                 word is required for the command to run, sudo will display an
225                 error message and exit.
226
227     -P, --preserve-groups
228                 Preserve the invoking user's group vector unaltered.  By
229                 default, the sudoers policy will initialize the group vector
230                 to the list of groups the target user is a member of.  The
231                 real and effective group-IDs, however, are still set to match
232                 the target user.
233
234     -p prompt, --prompt=prompt
235                 Use a custom password prompt with optional escape sequences.
236                 The following percent (‘%’) escape sequences are supported by
237                 the sudoers policy:
238
239                 %H  expanded to the host name including the domain name (on
240                     if the machine's host name is fully qualified or the fqdn
241                     option is set in sudoers(5))
242
243                 %h  expanded to the local host name without the domain name
244
245                 %p  expanded to the name of the user whose password is being
246                     requested (respects the rootpw, targetpw, and runaspw
247                     flags in sudoers(5))
248
249                 %U  expanded to the login name of the user the command will
250                     be run as (defaults to root unless the -u option is also
251                     specified)
252
253                 %u  expanded to the invoking user's login name
254
255                 %%  two consecutive ‘%’ characters are collapsed into a sin‐
256                     gle ‘%’ character
257
258                 The custom prompt will override the default prompt specified
259                 by either the security policy or the SUDO_PROMPT environment
260                 variable.  On systems that use PAM, the custom prompt will
261                 also override the prompt specified by a PAM module unless the
262                 passprompt_override flag is disabled in sudoers.
263
264     -r role, --role=role
265                 Run the command with an SELinux security context that
266                 includes the specified role.
267
268     -S, --stdin
269                 Write the prompt to the standard error and read the password
270                 from the standard input instead of using the terminal device.
271
272     -s, --shell
273                 Run the shell specified by the SHELL environment variable if
274                 it is set or the shell specified by the invoking user's pass‐
275                 word database entry.  If a command is specified, it is passed
276                 to the shell for execution via the shell's -c option.  If no
277                 command is specified, an interactive shell is executed.  Note
278                 that most shells behave differently when a command is speci‐
279                 fied as compared to an interactive session; consult the
280                 shell's manual for details.
281
282     -t type, --type=type
283                 Run the command with an SELinux security context that
284                 includes the specified type.  If no type is specified, the
285                 default type is derived from the role.
286
287     -U user, --other-user=user
288                 Used in conjunction with the -l option to list the privileges
289                 for user instead of for the invoking user.  The security pol‐
290                 icy may restrict listing other users' privileges.  The
291                 sudoers policy only allows root or a user with the ALL privi‐
292                 lege on the current host to use this option.
293
294     -T timeout, --command-timeout=timeout
295                 Used to set a timeout for the command.  If the timeout
296                 expires before the command has exited, the command will be
297                 terminated.  The security policy may restrict the ability to
298                 set command timeouts.  The sudoers policy requires that user-
299                 specified timeouts be explicitly enabled.
300
301     -u user, --user=user
302                 Run the command as a user other than the default target user
303                 (usually root).  The user may be either a user name or a
304                 numeric user-ID (UID) prefixed with the ‘#’ character (e.g.,
305                 #0 for UID 0).  When running commands as a UID, many shells
306                 require that the ‘#’ be escaped with a backslash (‘\’).  Some
307                 security policies may restrict UIDs to those listed in the
308                 password database.  The sudoers policy allows UIDs that are
309                 not in the password database as long as the targetpw option
310                 is not set.  Other security policies may not support this.
311
312     -V, --version
313                 Print the sudo version string as well as the version string
314                 of the security policy plugin and any I/O plugins.  If the
315                 invoking user is already root the -V option will display the
316                 arguments passed to configure when sudo was built and plugins
317                 may display more verbose information such as default options.
318
319     -v, --validate
320                 Update the user's cached credentials, authenticating the user
321                 if necessary.  For the sudoers plugin, this extends the sudo
322                 timeout for another 5 minutes by default, but does not run a
323                 command.  Not all security policies support cached creden‐
324                 tials.
325
326     --          The -- option indicates that sudo should stop processing com‐
327                 mand line arguments.
328
329     Environment variables to be set for the command may also be passed on the
330     command line in the form of VAR=value, e.g.,
331     LD_LIBRARY_PATH=/usr/local/pkg/lib.  Variables passed on the command line
332     are subject to restrictions imposed by the security policy plugin.  The
333     sudoers policy subjects variables passed on the command line to the same
334     restrictions as normal environment variables with one important excep‐
335     tion.  If the setenv option is set in sudoers, the command to be run has
336     the SETENV tag set or the command matched is ALL, the user may set vari‐
337     ables that would otherwise be forbidden.  See sudoers(5) for more infor‐
338     mation.
339

COMMAND EXECUTION

341     When sudo executes a command, the security policy specifies the execution
342     environment for the command.  Typically, the real and effective user and
343     group and IDs are set to match those of the target user, as specified in
344     the password database, and the group vector is initialized based on the
345     group database (unless the -P option was specified).
346
347     The following parameters may be specified by security policy:
348
349     ·  real and effective user-ID
350
351     ·  real and effective group-ID
352
353     ·  supplementary group-IDs
354
355     ·  the environment list
356
357     ·  current working directory
358
359     ·  file creation mode mask (umask)
360
361     ·  SELinux role and type
362
363     ·  scheduling priority (aka nice value)
364
365   Process model
366     There are two distinct ways sudo can run a command.
367
368     If an I/O logging plugin is configured or if the security policy explic‐
369     itly requests it, a new pseudo-terminal (“pty”) is allocated and fork(2)
370     is used to create a second sudo process, referred to as the monitor.  The
371     monitor creates a new terminal session with itself as the leader and the
372     pty as its controlling terminal, calls fork(2), sets up the execution
373     environment as described above, and then uses the execve(2) system call
374     to run the command in the child process.  The monitor exists to relay job
375     control signals between the user's existing terminal and the pty the com‐
376     mand is being run in.  This makes it possible to suspend and resume the
377     command.  Without the monitor, the command would be in what POSIX terms
378     an “orphaned process group” and it would not receive any job control sig‐
379     nals from the kernel.  When the command exits or is terminated by a sig‐
380     nal, the monitor passes the command's exit status to the main sudo
381     process and exits.  After receiving the command's exit status, the main
382     sudo passes the command's exit status to the security policy's close
383     function and exits.
384
385     If no pty is used, sudo calls fork(2), sets up the execution environment
386     as described above, and uses the execve(2) system call to run the command
387     in the child process.  The main sudo process waits until the command has
388     completed, then passes the command's exit status to the security policy's
389     close function and exits.  As a special case, if the policy plugin does
390     not define a close function, sudo will execute the command directly
391     instead of calling fork(2) first.  The sudoers policy plugin will only
392     define a close function when I/O logging is enabled, a pty is required,
393     or the pam_session or pam_setcred options are enabled.  Note that
394     pam_session and pam_setcred are enabled by default on systems using PAM.
395
396   Signal handling
397     When the command is run as a child of the sudo process, sudo will relay
398     signals it receives to the command.  The SIGINT and SIGQUIT signals are
399     only relayed when the command is being run in a new pty or when the sig‐
400     nal was sent by a user process, not the kernel.  This prevents the com‐
401     mand from receiving SIGINT twice each time the user enters control-C.
402     Some signals, such as SIGSTOP and SIGKILL, cannot be caught and thus will
403     not be relayed to the command.  As a general rule, SIGTSTP should be used
404     instead of SIGSTOP when you wish to suspend a command being run by sudo.
405
406     As a special case, sudo will not relay signals that were sent by the com‐
407     mand it is running.  This prevents the command from accidentally killing
408     itself.  On some systems, the reboot(8) command sends SIGTERM to all non-
409     system processes other than itself before rebooting the system.  This
410     prevents sudo from relaying the SIGTERM signal it received back to
411     reboot(8), which might then exit before the system was actually rebooted,
412     leaving it in a half-dead state similar to single user mode.  Note, how‐
413     ever, that this check only applies to the command run by sudo and not any
414     other processes that the command may create.  As a result, running a
415     script that calls reboot(8) or shutdown(8) via sudo may cause the system
416     to end up in this undefined state unless the reboot(8) or shutdown(8) are
417     run using the exec() family of functions instead of system() (which
418     interposes a shell between the command and the calling process).
419
420     If no I/O logging plugins are loaded and the policy plugin has not
421     defined a close() function, set a command timeout or required that the
422     command be run in a new pty, sudo may execute the command directly
423     instead of running it as a child process.
424
425   Plugins
426     Plugins may be specified via Plugin directives in the sudo.conf(5) file.
427     They may be loaded as dynamic shared objects (on systems that support
428     them), or compiled directly into the sudo binary.  If no sudo.conf(5)
429     file is present, or it contains no Plugin lines, sudo will use the tradi‐
430     tional sudoers security policy and I/O logging.  See the sudo.conf(5)
431     manual for details of the /etc/sudo.conf file and the sudo_plugin(5) man‐
432     ual for more information about the sudo plugin architecture.
433

EXIT VALUE

435     Upon successful execution of a command, the exit status from sudo will be
436     the exit status of the program that was executed.  If the command termi‐
437     nated due to receipt of a signal, sudo will send itself the same signal
438     that terminated the command.
439
440     If the -l option was specified without a command, sudo will exit with a
441     value of 0 if the user is allowed to run sudo and they authenticated suc‐
442     cessfully (as required by the security policy).  If a command is speci‐
443     fied with the -l option, the exit value will only be 0 if the command is
444     permitted by the security policy, otherwise it will be 1.
445
446     If there is an authentication failure, a configuration/permission problem
447     or if the given command cannot be executed, sudo exits with a value of 1.
448     In the latter case, the error string is printed to the standard error.
449     If sudo cannot stat(2) one or more entries in the user's PATH, an error
450     is printed to the standard error.  (If the directory does not exist or if
451     it is not really a directory, the entry is ignored and no error is
452     printed.)  This should not happen under normal circumstances.  The most
453     common reason for stat(2) to return “permission denied” is if you are
454     running an automounter and one of the directories in your PATH is on a
455     machine that is currently unreachable.
456

SECURITY NOTES

458     sudo tries to be safe when executing external commands.
459
460     To prevent command spoofing, sudo checks "." and "" (both denoting cur‐
461     rent directory) last when searching for a command in the user's PATH (if
462     one or both are in the PATH).  Note, however, that the actual PATH envi‐
463     ronment variable is not modified and is passed unchanged to the program
464     that sudo executes.
465
466     Users should never be granted sudo privileges to execute files that are
467     writable by the user or that reside in a directory that is writable by
468     the user.  If the user can modify or replace the command there is no way
469     to limit what additional commands they can run.
470
471     Please note that sudo will normally only log the command it explicitly
472     runs.  If a user runs a command such as sudo su or sudo sh, subsequent
473     commands run from that shell are not subject to sudo's security policy.
474     The same is true for commands that offer shell escapes (including most
475     editors).  If I/O logging is enabled, subsequent commands will have their
476     input and/or output logged, but there will not be traditional logs for
477     those commands.  Because of this, care must be taken when giving users
478     access to commands via sudo to verify that the command does not inadver‐
479     tently give the user an effective root shell.  For more information,
480     please see the Preventing shell escapes section in sudoers(5).
481
482     To prevent the disclosure of potentially sensitive information, sudo dis‐
483     ables core dumps by default while it is executing (they are re-enabled
484     for the command that is run).  This historical practice dates from a time
485     when most operating systems allowed set-user-ID processes to dump core by
486     default.  To aid in debugging sudo crashes, you may wish to re-enable
487     core dumps by setting “disable_coredump” to false in the sudo.conf(5)
488     file as follows:
489
490           Set disable_coredump false
491
492     See the sudo.conf(5) manual for more information.
493

ENVIRONMENT

495     sudo utilizes the following environment variables.  The security policy
496     has control over the actual content of the command's environment.
497
498     EDITOR           Default editor to use in -e (sudoedit) mode if neither
499                      SUDO_EDITOR nor VISUAL is set.
500
501     MAIL             Set to the mail spool of the target user when the -i
502                      option is specified or when env_reset is enabled in
503                      sudoers (unless MAIL is present in the env_keep list).
504
505     HOME             Set to the home directory of the target user when the -i
506                      or -H options are specified, when the -s option is spec‐
507                      ified and set_home is set in sudoers, when
508                      always_set_home is enabled in sudoers, or when env_reset
509                      is enabled in sudoers and HOME is not present in the
510                      env_keep list.
511
512     LOGNAME          Set to the login name of the target user when the -i
513                      option is specified, when the set_logname option is
514                      enabled in sudoers or when the env_reset option is
515                      enabled in sudoers (unless LOGNAME is present in the
516                      env_keep list).
517
518     PATH             May be overridden by the security policy.
519
520     SHELL            Used to determine shell to run with -s option.
521
522     SUDO_ASKPASS     Specifies the path to a helper program used to read the
523                      password if no terminal is available or if the -A option
524                      is specified.
525
526     SUDO_COMMAND     Set to the command run by sudo.
527
528     SUDO_EDITOR      Default editor to use in -e (sudoedit) mode.
529
530     SUDO_GID         Set to the group-ID of the user who invoked sudo.
531
532     SUDO_PROMPT      Used as the default password prompt unless the -p option
533                      was specified.
534
535     SUDO_PS1         If set, PS1 will be set to its value for the program
536                      being run.
537
538     SUDO_UID         Set to the user-ID of the user who invoked sudo.
539
540     SUDO_USER        Set to the login name of the user who invoked sudo.
541
542     USER             Set to the same value as LOGNAME, described above.
543
544     VISUAL           Default editor to use in -e (sudoedit) mode if
545                      SUDO_EDITOR is not set.
546

FILES

548     /etc/sudo.conf            sudo front end configuration
549

EXAMPLES

551     Note: the following examples assume a properly configured security pol‐
552     icy.
553
554     To get a file listing of an unreadable directory:
555
556           $ sudo ls /usr/local/protected
557
558     To list the home directory of user yaz on a machine where the file system
559     holding ~yaz is not exported as root:
560
561           $ sudo -u yaz ls ~yaz
562
563     To edit the index.html file as user www:
564
565           $ sudoedit -u www ~www/htdocs/index.html
566
567     To view system logs only accessible to root and users in the adm group:
568
569           $ sudo -g adm more /var/log/syslog
570
571     To run an editor as jim with a different primary group:
572
573           $ sudoedit -u jim -g audio ~jim/sound.txt
574
575     To shut down a machine:
576
577           $ sudo shutdown -r +15 "quick reboot"
578
579     To make a usage listing of the directories in the /home partition.  Note
580     that this runs the commands in a sub-shell to make the cd and file redi‐
581     rection work.
582
583           $ sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"
584

DIAGNOSTICS

586     Error messages produced by sudo include:
587
588     editing files in a writable directory is not permitted
589           By default, sudoedit does not permit editing a file when any of the
590           parent directories are writable by the invoking user.  This avoids
591           a race condition that could allow the user to overwrite an arbi‐
592           trary file.  See the sudoedit_checkdir option in sudoers(5) for
593           more information.
594
595     editing symbolic links is not permitted
596           By default, sudoedit does not follow symbolic links when opening
597           files.  See the sudoedit_follow option in sudoers(5) for more
598           information.
599
600     effective uid is not 0, is sudo installed setuid root?
601           sudo was not run with root privileges.  The sudo binary must be
602           owned by the root user and have the set-user-ID bit set.  Also, it
603           must not be located on a file system mounted with the ‘nosuid’
604           option or on an NFS file system that maps uid 0 to an unprivileged
605           uid.
606
607     effective uid is not 0, is sudo on a file system with the 'nosuid' option
608           set or an NFS file system without root privileges?
609           sudo was not run with root privileges.  The sudo binary has the
610           proper owner and permissions but it still did not run with root
611           privileges.  The most common reason for this is that the file sys‐
612           tem the sudo binary is located on is mounted with the ‘nosuid’
613           option or it is an NFS file system that maps uid 0 to an unprivi‐
614           leged uid.
615
616     fatal error, unable to load plugins
617           An error occurred while loading or initializing the plugins speci‐
618           fied in sudo.conf(5).
619
620     invalid environment variable name
621           One or more environment variable names specified via the -E option
622           contained an equal sign (‘=’).  The arguments to the -E option
623           should be environment variable names without an associated value.
624
625     no password was provided
626           When sudo tried to read the password, it did not receive any char‐
627           acters.  This may happen if no terminal is available (or the -S
628           option is specified) and the standard input has been redirected
629           from /dev/null.
630
631     a terminal is required to read the password
632           sudo needs to read the password but there is no mechanism available
633           for it to do so.  A terminal is not present to read the password
634           from, sudo has not been configured to read from the standard input,
635           the -S option was not used, and no askpass helper has been speci‐
636           fied either via the sudo.conf(5) file or the SUDO_ASKPASS environ‐
637           ment variable.
638
639     no writable temporary directory found
640           sudoedit was unable to find a usable temporary directory in which
641           to store its intermediate files.
642
643     sudo must be owned by uid 0 and have the setuid bit set
644           sudo was not run with root privileges.  The sudo binary does not
645           have the correct owner or permissions.  It must be owned by the
646           root user and have the set-user-ID bit set.
647
648     sudoedit is not supported on this platform
649           It is only possible to run sudoedit on systems that support setting
650           the effective user-ID.
651
652     timed out reading password
653           The user did not enter a password before the password timeout (5
654           minutes by default) expired.
655
656     you do not exist in the passwd database
657           Your user-ID does not appear in the system passwd database.
658
659     you may not specify environment variables in edit mode
660           It is only possible to specify environment variables when running a
661           command.  When editing a file, the editor is run with the user's
662           environment unmodified.
663

SEE ALSO

665     su(1), stat(2), login_cap(3), passwd(5), sudo.conf(5), sudo_plugin(5),
666     sudoers(5), sudoers_timestamp(5), sudoreplay(8), visudo(8)
667

HISTORY

669     See the HISTORY file in the sudo distribution (https://www.sudo.ws/his
670     tory.html) for a brief history of sudo.
671

AUTHORS

673     Many people have worked on sudo over the years; this version consists of
674     code written primarily by:
675
676           Todd C. Miller
677
678     See the CONTRIBUTORS file in the sudo distribution
679     (https://www.sudo.ws/contributors.html) for an exhaustive list of people
680     who have contributed to sudo.
681

CAVEATS

683     There is no easy way to prevent a user from gaining a root shell if that
684     user is allowed to run arbitrary commands via sudo.  Also, many programs
685     (such as editors) allow the user to run commands via shell escapes, thus
686     avoiding sudo's checks.  However, on most systems it is possible to pre‐
687     vent shell escapes with the sudoers(5) plugin's noexec functionality.
688
689     It is not meaningful to run the cd command directly via sudo, e.g.,
690
691           $ sudo cd /usr/local/protected
692
693     since when the command exits the parent process (your shell) will still
694     be the same.  Please see the EXAMPLES section for more information.
695
696     Running shell scripts via sudo can expose the same kernel bugs that make
697     set-user-ID shell scripts unsafe on some operating systems (if your OS
698     has a /dev/fd/ directory, set-user-ID shell scripts are generally safe).
699

BUGS

701     If you feel you have found a bug in sudo, please submit a bug report at
702     https://bugzilla.sudo.ws/
703

SUPPORT

705     Limited free support is available via the sudo-users mailing list, see
706     https://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search
707     the archives.
708

DISCLAIMER

710     sudo is provided “AS IS” and any express or implied warranties, includ‐
711     ing, but not limited to, the implied warranties of merchantability and
712     fitness for a particular purpose are disclaimed.  See the LICENSE file
713     distributed with sudo or https://www.sudo.ws/license.html for complete
714     details.
715
716Sudo 1.9.0b4                   October 20, 2019                   Sudo 1.9.0b4
Impressum