Home Explore Blog CI



man-pages

2nd chunk of `sudo.man`
3114a79df759fa3a81e8c69588eaffab132b35b97bba35950000000100000fd6
 tempts  to  run  sudo.   If  an  I/O  plugin  is configured, the running
       command’s input and output may be logged as well.

       The options are as follows:

       -A, -‐askpass
               Normally, if sudo requires a password, it will read it from  the
               user’s  terminal.   If  the  -A (askpass) option is specified, a
               (possibly graphical) helper program  is  executed  to  read  the
               user’s  password and output the password to the standard output.
               If the SUDO_ASKPASS environment variable is  set,  it  specifies
               the path to the helper program.  Otherwise, if sudo.conf(5) con‐
               tains  a line specifying the askpass program, that value will be
               used.  For example:

                   # Path to askpass helper program
                   Path askpass /usr/X11R6/bin/ssh‐askpass

               If no askpass program is available, sudo will exit with  an  er‐
               ror.

       -B, -‐bell
               Ring  the bell as part of the password prompt when a terminal is
               present.  This option has no effect if  an  askpass  program  is
               used.

       -b, -‐background
               Run  the given command in the background.  It is not possible to
               use shell job control to manipulate background processes started
               by sudo.  Most interactive commands will fail to  work  properly
               in background mode.

       -C num, -‐close‐from=num
               Close  all  file descriptors greater than or equal to num before
               executing a command.  Values less than three are not  permitted.
               By default, sudo will close all open file descriptors other than
               standard input, standard output, and standard error when execut‐
               ing  a  command.   The  security  policy may restrict the user’s
               ability to use this option.  The sudoers policy only permits use
               of  the  -C  option  when  the  administrator  has  enabled  the
               closefrom_override option.

       -D directory, -‐chdir=directory
               Run  the  command in the specified directory instead of the cur‐
               rent working directory.  The security policy may return an error
               if the user does not have permission to specify the working  di‐
               rectory.

       -E, -‐preserve‐env
               Indicates  to  the  security policy that the user wishes to pre‐
               serve their existing environment variables.  The security policy
               may return an error if the user does not have permission to pre‐
               serve the environment.

       -‐preserve‐env=list
               Indicates to the security policy that the user wishes to add the
               comma‐separated list of environment variables to those preserved
               from the user’s environment.  The security policy may return  an
               error if the user does not have permission to preserve the envi‐
               ronment.  This option may be specified multiple times.

       -e, -‐edit
               Edit one or more files instead of running a command.  In lieu of
               a  path  name, the string "sudoedit" is used when consulting the
               security policy.  If the user is authorized by the  policy,  the
               following steps are taken:

               1.   Temporary  copies  are  made of the files to be edited with
                    the owner set to the invoking user.

               2.   The editor specified by the policy is run to edit the  tem‐
                    porary  files.   The  sudoers  policy uses the SUDO_EDITOR,
                    VISUAL and EDITOR environment variables  (in  that  order).
                    If none of SUDO_EDITOR, VISUAL or EDITOR are set, the first
                    program listed in the editor sudoers(5) option is used.

     

Title: Sudo Command Options: Askpass, Bell, Background, and More
Summary
This section details various options for the `sudo` command. It covers options like `-A` (askpass) for using a helper program for password entry, `-B` (bell) to ring the bell during the password prompt, `-b` (background) to run commands in the background, `-C` (close-from) to close file descriptors, `-D` (chdir) to change the working directory, `-E` (preserve-env) to preserve environment variables, and `-e` (edit) to edit files using a policy-defined editor. It also describes how the editor is selected via environment variables like `SUDO_EDITOR`, `VISUAL`, and `EDITOR`.