Annotation of embedaddon/sudo/doc/sudo.cat, revision 1.1.1.6

1.1.1.3   misho       1: SUDO(1m)                     System Manager's Manual                    SUDO(1m)
1.1       misho       2: 
                      3: NNAAMMEE
1.1.1.3   misho       4:      ssuuddoo, ssuuddooeeddiitt - execute a command as another user
1.1       misho       5: 
                      6: SSYYNNOOPPSSIISS
1.1.1.3   misho       7:      ssuuddoo --hh | --KK | --kk | --VV
1.1.1.5   misho       8:      ssuuddoo --vv [--AAkknnSS] [--aa _t_y_p_e] [--gg _g_r_o_u_p] [--hh _h_o_s_t] [--pp _p_r_o_m_p_t] [--uu _u_s_e_r]
                      9:      ssuuddoo --ll [--AAkknnSS] [--aa _t_y_p_e] [--gg _g_r_o_u_p] [--hh _h_o_s_t] [--pp _p_r_o_m_p_t] [--UU _u_s_e_r]
                     10:           [--uu _u_s_e_r] [_c_o_m_m_a_n_d]
                     11:      ssuuddoo [--AAbbEEHHnnPPSS] [--aa _t_y_p_e] [--CC _n_u_m] [--cc _c_l_a_s_s] [--gg _g_r_o_u_p] [--hh _h_o_s_t]
1.1.1.6 ! misho      12:           [--pp _p_r_o_m_p_t] [--rr _r_o_l_e] [--tt _t_y_p_e] [--uu _u_s_e_r] [_V_A_R=_v_a_l_u_e] [--ii | --ss]
1.1.1.5   misho      13:           [_c_o_m_m_a_n_d]
                     14:      ssuuddooeeddiitt [--AAkknnSS] [--aa _t_y_p_e] [--CC _n_u_m] [--cc _c_l_a_s_s] [--gg _g_r_o_u_p] [--hh _h_o_s_t]
1.1.1.6 ! misho      15:               [--pp _p_r_o_m_p_t] [--uu _u_s_e_r] _f_i_l_e _._._.
1.1       misho      16: 
                     17: DDEESSCCRRIIPPTTIIOONN
1.1.1.3   misho      18:      ssuuddoo allows a permitted user to execute a _c_o_m_m_a_n_d as the superuser or
                     19:      another user, as specified by the security policy.
                     20: 
                     21:      ssuuddoo supports a plugin architecture for security policies and
                     22:      input/output logging.  Third parties can develop and distribute their own
                     23:      policy and I/O logging plugins to work seamlessly with the ssuuddoo front
                     24:      end.  The default security policy is _s_u_d_o_e_r_s, which is configured via the
1.1.1.4   misho      25:      file _/_e_t_c_/_s_u_d_o_e_r_s, or via LDAP.  See the _P_l_u_g_i_n_s section for more
1.1.1.3   misho      26:      information.
                     27: 
                     28:      The security policy determines what privileges, if any, a user has to run
                     29:      ssuuddoo.  The policy may require that users authenticate themselves with a
                     30:      password or another authentication mechanism.  If authentication is
                     31:      required, ssuuddoo 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 _s_u_d_o_e_r_s security policy is 5 minutes.
                     34: 
                     35:      Security policies may support credential caching to allow the user to run
                     36:      ssuuddoo again for a period of time without requiring authentication.  The
                     37:      _s_u_d_o_e_r_s policy caches credentials for 5 minutes, unless overridden in
                     38:      sudoers(4).  By running ssuuddoo with the --vv option, a user can update the
                     39:      cached credentials without running a _c_o_m_m_a_n_d.
                     40: 
                     41:      When invoked as ssuuddooeeddiitt, the --ee option (described below), is implied.
                     42: 
                     43:      Security policies may log successful and failed attempts to use ssuuddoo.  If
                     44:      an I/O plugin is configured, the running command's input and output may
                     45:      be logged as well.
                     46: 
                     47:      The options are as follows:
                     48: 
1.1.1.5   misho      49:      --AA, ----aasskkppaassss
                     50:                  Normally, if ssuuddoo requires a password, it will read it from
1.1.1.3   misho      51:                  the user's terminal.  If the --AA (_a_s_k_p_a_s_s) option is
                     52:                  specified, a (possibly graphical) helper program is executed
                     53:                  to read the user's password and output the password to the
                     54:                  standard output.  If the SUDO_ASKPASS environment variable is
                     55:                  set, it specifies the path to the helper program.  Otherwise,
1.1.1.4   misho      56:                  if sudo.conf(4) contains a line specifying the askpass
1.1.1.3   misho      57:                  program, that value will be used.  For example:
                     58: 
                     59:                      # Path to askpass helper program
                     60:                      Path askpass /usr/X11R6/bin/ssh-askpass
                     61: 
                     62:                  If no askpass program is available, ssuuddoo will exit with an
                     63:                  error.
                     64: 
1.1.1.5   misho      65:      --aa _t_y_p_e, ----aauutthh--ttyyppee=_t_y_p_e
                     66:                  Use the specified BSD authentication _t_y_p_e when validating the
                     67:                  user, if allowed by _/_e_t_c_/_l_o_g_i_n_._c_o_n_f.  The system
                     68:                  administrator may specify a list of sudo-specific
                     69:                  authentication methods by adding an ``auth-sudo'' entry in
                     70:                  _/_e_t_c_/_l_o_g_i_n_._c_o_n_f.  This option is only available on systems
                     71:                  that support BSD authentication.
                     72: 
                     73:      --bb, ----bbaacckkggrroouunndd
                     74:                  Run the given command in the background.  Note that it is not
                     75:                  possible to use shell job control to manipulate background
                     76:                  processes started by ssuuddoo.  Most interactive commands will
                     77:                  fail to work properly in background mode.
                     78: 
                     79:      --CC _n_u_m, ----cclloossee--ffrroomm=_n_u_m
                     80:                  Close all file descriptors greater than or equal to _n_u_m
                     81:                  before executing a command.  Values less than three are not
                     82:                  permitted.  By default, ssuuddoo will close all open file
                     83:                  descriptors other than standard input, standard output and
                     84:                  standard error when executing a command.  The security policy
                     85:                  may restrict the user's ability to use this option.  The
                     86:                  _s_u_d_o_e_r_s policy only permits use of the --CC option when the
1.1.1.3   misho      87:                  administrator has enabled the _c_l_o_s_e_f_r_o_m___o_v_e_r_r_i_d_e option.
                     88: 
1.1.1.5   misho      89:      --cc _c_l_a_s_s, ----llooggiinn--ccllaassss=_c_l_a_s_s
                     90:                  Run the command with resource limits and scheduling priority
                     91:                  of the specified login _c_l_a_s_s.  The _c_l_a_s_s argument can be
                     92:                  either a class name as defined in _/_e_t_c_/_l_o_g_i_n_._c_o_n_f, or a
1.1.1.6 ! misho      93:                  single `-' character.  If _c_l_a_s_s is --, the default login class
1.1.1.5   misho      94:                  of the target user will be used.  Otherwise, the command must
1.1.1.6 ! misho      95:                  be run as the superuser (user ID 0), or ssuuddoo must be run from
        !            96:                  a shell that is already running as the superuser.  If the
        !            97:                  command is being run as a login shell, additional
        !            98:                  _/_e_t_c_/_l_o_g_i_n_._c_o_n_f settings, such as the umask and environment
        !            99:                  variables, will be applied, if present.  This option is only
        !           100:                  available on systems with BSD login classes.
1.1.1.5   misho     101: 
                    102:      --EE, ----pprreesseerrvvee--eennvv
                    103:                  Indicates to the security policy that the user wishes to
                    104:                  preserve their existing environment variables.  The security
                    105:                  policy may return an error if the user does not have
                    106:                  permission to preserve the environment.
                    107: 
                    108:      --ee, ----eeddiitt  Edit one or more files instead of running a command.  In lieu
                    109:                  of a path name, the string "sudoedit" is used when consulting
1.1.1.3   misho     110:                  the security policy.  If the user is authorized by the
                    111:                  policy, the following steps are taken:
1.1       misho     112: 
1.1.1.3   misho     113:                   1.   Temporary copies are made of the files to be edited
1.1       misho     114:                        with the owner set to the invoking user.
                    115: 
1.1.1.3   misho     116:                   2.   The editor specified by the policy is run to edit the
1.1       misho     117:                        temporary files.  The _s_u_d_o_e_r_s policy uses the
                    118:                        SUDO_EDITOR, VISUAL and EDITOR environment variables
                    119:                        (in that order).  If none of SUDO_EDITOR, VISUAL or
                    120:                        EDITOR are set, the first program listed in the _e_d_i_t_o_r
1.1.1.3   misho     121:                        sudoers(4) option is used.
1.1       misho     122: 
1.1.1.3   misho     123:                   3.   If they have been modified, the temporary files are
1.1       misho     124:                        copied back to their original location and the
                    125:                        temporary versions are removed.
                    126: 
1.1.1.3   misho     127:                  If the specified file does not exist, it will be created.
                    128:                  Note that unlike most commands run by _s_u_d_o, the editor is run
                    129:                  with the invoking user's environment unmodified.  If, for
                    130:                  some reason, ssuuddoo is unable to update a file with its edited
                    131:                  version, the user will receive a warning and the edited copy
                    132:                  will remain in a temporary file.
                    133: 
1.1.1.5   misho     134:      --gg _g_r_o_u_p, ----ggrroouupp=_g_r_o_u_p
                    135:                  Run the command with the primary group set to _g_r_o_u_p instead
                    136:                  of the primary group specified by the target user's password
                    137:                  database entry.  The _g_r_o_u_p may be either a group name or a
                    138:                  numeric group ID (GID) prefixed with the `#' character (e.g.
                    139:                  #0 for GID 0).  When running a command as a GID, many shells
1.1.1.3   misho     140:                  require that the `#' be escaped with a backslash (`\').  If
                    141:                  no --uu option is specified, the command will be run as the
1.1.1.5   misho     142:                  invoking user.  In either case, the primary group will be set
                    143:                  to _g_r_o_u_p.
1.1.1.3   misho     144: 
1.1.1.5   misho     145:      --HH, ----sseett--hhoommee
                    146:                  Request that the security policy set the HOME environment
                    147:                  variable to the home directory specified by the target user's
                    148:                  password database entry.  Depending on the policy, this may
                    149:                  be the default behavior.
                    150: 
                    151:      --hh, ----hheellpp  Display a short help message to the standard output and exit.
                    152: 
                    153:      --hh _h_o_s_t, ----hhoosstt=_h_o_s_t
                    154:                  Run the command on the specified _h_o_s_t if the security policy
                    155:                  plugin supports remote commands.  Note that the _s_u_d_o_e_r_s
                    156:                  plugin does not currently support running remote commands.
                    157:                  This may also be used in conjunction with the --ll option to
                    158:                  list a user's privileges for the remote host.
                    159: 
                    160:      --ii, ----llooggiinn
                    161:                  Run the shell specified by the target user's password
                    162:                  database entry as a login shell.  This means that login-
                    163:                  specific resource files such as _._p_r_o_f_i_l_e or _._l_o_g_i_n will be
                    164:                  read by the shell.  If a command is specified, it is passed
                    165:                  to the shell for execution via the shell's --cc option.  If no
                    166:                  command is specified, an interactive shell is executed.  ssuuddoo
                    167:                  attempts to change to that user's home directory before
                    168:                  running the shell.  The command is run with an environment
                    169:                  similar to the one a user would receive at log in.  The
                    170:                  _C_o_m_m_a_n_d _E_n_v_i_r_o_n_m_e_n_t section in the sudoers(4) manual
                    171:                  documents how the --ii option affects the environment in which
                    172:                  a command is run when the _s_u_d_o_e_r_s policy is in use.
                    173: 
                    174:      --KK, ----rreemmoovvee--ttiimmeessttaammpp
                    175:                  Similar to the --kk option, except that it removes the user's
                    176:                  cached credentials entirely and may not be used in
1.1.1.3   misho     177:                  conjunction with a command or other option.  This option does
                    178:                  not require a password.  Not all security policies support
                    179:                  credential caching.
                    180: 
1.1.1.5   misho     181:      --kk, ----rreesseett--ttiimmeessttaammpp
                    182:                  When used without a command, invalidates the user's cached
                    183:                  credentials.  In other words, the next time ssuuddoo is run a
1.1.1.3   misho     184:                  password will be required.  This option does not require a
                    185:                  password and was added to allow a user to revoke ssuuddoo
1.1.1.5   misho     186:                  permissions from a _._l_o_g_o_u_t file.
1.1.1.3   misho     187: 
                    188:                  When used in conjunction with a command or an option that may
1.1.1.5   misho     189:                  require a password, this option will cause ssuuddoo to ignore the
                    190:                  user's cached credentials.  As a result, ssuuddoo will prompt for
                    191:                  a password (if one is required by the security policy) and
                    192:                  will not update the user's cached credentials.
                    193: 
                    194:                  Not all security policies support credential caching.
                    195: 
                    196:      --ll, ----lliisstt  If no _c_o_m_m_a_n_d is specified, list the allowed (and forbidden)
                    197:                  commands for the invoking user (or the user specified by the
                    198:                  --UU option) on the current host.  A longer list format is used
                    199:                  if this option is specified multiple times and the security
                    200:                  policy supports a verbose output format.
                    201: 
1.1.1.3   misho     202:                  If a _c_o_m_m_a_n_d is specified and is permitted by the security
                    203:                  policy, the fully-qualified path to the command is displayed
                    204:                  along with any command line arguments.  If _c_o_m_m_a_n_d is
                    205:                  specified but not allowed, ssuuddoo will exit with a status value
1.1.1.5   misho     206:                  of 1.
                    207: 
                    208:      --nn, ----nnoonn--iinntteerraaccttiivvee
                    209:                  Avoid prompting the user for input of any kind.  If a
                    210:                  password is required for the command to run, ssuuddoo will
                    211:                  display an error message and exit.
                    212: 
                    213:      --PP, ----pprreesseerrvvee--ggrroouuppss
                    214:                  Preserve the invoking user's group vector unaltered.  By
                    215:                  default, the _s_u_d_o_e_r_s policy will initialize the group vector
                    216:                  to the list of groups the target user is a member of.  The
                    217:                  real and effective group IDs, however, are still set to match
                    218:                  the target user.
                    219: 
                    220:      --pp _p_r_o_m_p_t, ----pprroommpptt=_p_r_o_m_p_t
                    221:                  Use a custom password prompt with optional escape sequences.
                    222:                  The following percent (`%') escape sequences are supported by
                    223:                  the _s_u_d_o_e_r_s policy:
1.1.1.3   misho     224: 
                    225:                  %H  expanded to the host name including the domain name (on
                    226:                      if the machine's host name is fully qualified or the _f_q_d_n
                    227:                      option is set in sudoers(4))
                    228: 
                    229:                  %h  expanded to the local host name without the domain name
                    230: 
                    231:                  %p  expanded to the name of the user whose password is being
                    232:                      requested (respects the _r_o_o_t_p_w, _t_a_r_g_e_t_p_w, and _r_u_n_a_s_p_w
                    233:                      flags in sudoers(4))
                    234: 
                    235:                  %U  expanded to the login name of the user the command will
                    236:                      be run as (defaults to root unless the --uu option is also
                    237:                      specified)
                    238: 
                    239:                  %u  expanded to the invoking user's login name
                    240: 
                    241:                  %%  two consecutive `%' characters are collapsed into a
                    242:                      single `%' character
                    243: 
1.1.1.5   misho     244:                  The custom prompt will override the system password prompt on
                    245:                  systems that support PAM unless the _p_a_s_s_p_r_o_m_p_t___o_v_e_r_r_i_d_e flag
                    246:                  is disabled in _s_u_d_o_e_r_s.
                    247: 
                    248:      --rr _r_o_l_e, ----rroollee=_r_o_l_e
                    249:                  Run the command with an SELinux security context that
                    250:                  includes the specified _r_o_l_e.
                    251: 
                    252:      --SS, ----ssttddiinn
                    253:                  Write the prompt to the standard error and read the password
                    254:                  from the standard input instead of using the terminal device.
                    255:                  The password must be followed by a newline character.
                    256: 
                    257:      --ss, ----sshheellll
                    258:                  Run the shell specified by the SHELL environment variable if
                    259:                  it is set or the shell specified by the invoking user's
                    260:                  password database entry.  If a command is specified, it is
1.1.1.3   misho     261:                  passed to the shell for execution via the shell's --cc option.
                    262:                  If no command is specified, an interactive shell is executed.
                    263: 
1.1.1.5   misho     264:      --tt _t_y_p_e, ----ttyyppee=_t_y_p_e
                    265:                  Run the command with an SELinux security context that
                    266:                  includes the specified _t_y_p_e.  If no _t_y_p_e is specified, the
                    267:                  default type is derived from the role.
                    268: 
                    269:      --UU _u_s_e_r, ----ootthheerr--uusseerr=_u_s_e_r
                    270:                  Used in conjunction with the --ll option to list the privileges
                    271:                  for _u_s_e_r instead of for the invoking user.  The security
                    272:                  policy may restrict listing other users' privileges.  The
                    273:                  _s_u_d_o_e_r_s policy only allows root or a user with the ALL
                    274:                  privilege on the current host to use this option.
                    275: 
                    276:      --uu _u_s_e_r, ----uusseerr=_u_s_e_r
                    277:                  Run the command as a user other than the default target user
                    278:                  (usually _r_o_o_t _)_. The _u_s_e_r may be either a user name or a
                    279:                  numeric user ID (UID) prefixed with the `#' character (e.g.
                    280:                  #0 for UID 0).  When running commands as a UID, many shells
                    281:                  require that the `#' be escaped with a backslash (`\').  Some
                    282:                  security policies may restrict UIDs to those listed in the
                    283:                  password database.  The _s_u_d_o_e_r_s policy allows UIDs that are
1.1.1.3   misho     284:                  not in the password database as long as the _t_a_r_g_e_t_p_w option
                    285:                  is not set.  Other security policies may not support this.
                    286: 
1.1.1.5   misho     287:      --VV, ----vveerrssiioonn
                    288:                  Print the ssuuddoo version string as well as the version string
                    289:                  of the security policy plugin and any I/O plugins.  If the
                    290:                  invoking user is already root the --VV option will display the
                    291:                  arguments passed to configure when ssuuddoo was built and plugins
                    292:                  may display more verbose information such as default options.
1.1.1.3   misho     293: 
1.1.1.5   misho     294:      --vv, ----vvaalliiddaattee
                    295:                  Update the user's cached credentials, authenticating the user
1.1.1.3   misho     296:                  if necessary.  For the _s_u_d_o_e_r_s plugin, this extends the ssuuddoo
1.1.1.5   misho     297:                  timeout for another 5 minutes by default, but does not run a
                    298:                  command.  Not all security policies support cached
                    299:                  credentials.
1.1.1.3   misho     300: 
                    301:      ----          The ---- option indicates that ssuuddoo should stop processing
                    302:                  command line arguments.
                    303: 
                    304:      Environment variables to be set for the command may also be passed on the
1.1.1.6 ! misho     305:      command line in the form of _V_A_R=_v_a_l_u_e, e.g.
        !           306:      LD_LIBRARY_PATH=_/_u_s_r_/_l_o_c_a_l_/_p_k_g_/_l_i_b.  Variables passed on the command line
1.1.1.5   misho     307:      are subject to restrictions imposed by the security policy plugin.  The
                    308:      _s_u_d_o_e_r_s policy subjects variables passed on the command line to the same
                    309:      restrictions as normal environment variables with one important
                    310:      exception.  If the _s_e_t_e_n_v option is set in _s_u_d_o_e_r_s, the command to be run
                    311:      has the SETENV tag set or the command matched is ALL, the user may set
                    312:      variables that would otherwise be forbidden.  See sudoers(4) for more
                    313:      information.
1.1.1.3   misho     314: 
                    315: CCOOMMMMAANNDD EEXXEECCUUTTIIOONN
                    316:      When ssuuddoo executes a command, the security policy specifies the execution
1.1.1.5   misho     317:      environment for the command.  Typically, the real and effective user and
                    318:      group and IDs are set to match those of the target user, as specified in
                    319:      the password database, and the group vector is initialized based on the
                    320:      group database (unless the --PP option was specified).
1.1.1.3   misho     321: 
                    322:      The following parameters may be specified by security policy:
                    323: 
                    324:      oo   real and effective user ID
                    325: 
                    326:      oo   real and effective group ID
                    327: 
                    328:      oo   supplementary group IDs
                    329: 
                    330:      oo   the environment list
                    331: 
                    332:      oo   current working directory
                    333: 
                    334:      oo   file creation mode mask (umask)
                    335: 
                    336:      oo   SELinux role and type
                    337: 
                    338:      oo   Solaris project
                    339: 
                    340:      oo   Solaris privileges
                    341: 
                    342:      oo   BSD login class
                    343: 
                    344:      oo   scheduling priority (aka nice value)
                    345: 
                    346:    PPrroocceessss mmooddeell
                    347:      When ssuuddoo runs a command, it calls fork(2), sets up the execution
                    348:      environment as described above, and calls the execve system call in the
                    349:      child process.  The main ssuuddoo process waits until the command has
                    350:      completed, then passes the command's exit status to the security policy's
1.1.1.4   misho     351:      close function and exits.  If an I/O logging plugin is configured or if
                    352:      the security policy explicitly requests it, a new  pseudo-terminal
                    353:      (``pty'') is created and a second ssuuddoo process is used to relay job
                    354:      control signals between the user's existing pty and the new pty the
                    355:      command is being run in.  This extra process makes it possible to, for
                    356:      example, suspend and resume the command.  Without it, the command would
                    357:      be in what POSIX terms an ``orphaned process group'' and it would not
                    358:      receive any job control signals.  As a special case, if the policy plugin
                    359:      does not define a close function and no pty is required, ssuuddoo will
1.1.1.5   misho     360:      execute the command directly instead of calling fork(2) first.  The
                    361:      _s_u_d_o_e_r_s policy plugin will only define a close function when I/O logging
                    362:      is enabled, a pty is required, or the _p_a_m___s_e_s_s_i_o_n or _p_a_m___s_e_t_c_r_e_d options
                    363:      are enabled.  Note that _p_a_m___s_e_s_s_i_o_n and _p_a_m___s_e_t_c_r_e_d are enabled by
                    364:      default on systems using PAM.
1.1.1.3   misho     365: 
                    366:    SSiiggnnaall hhaannddlliinngg
1.1.1.5   misho     367:      When the command is run as a child of the ssuuddoo process, ssuuddoo will relay
                    368:      signals it receives to the command.  Unless the command is being run in a
                    369:      new pty, the SIGHUP, SIGINT and SIGQUIT signals are not relayed unless
                    370:      they are sent by a user process, not the kernel.  Otherwise, the command
                    371:      would receive SIGINT twice every time the user entered control-C.  Some
                    372:      signals, such as SIGSTOP and SIGKILL, cannot be caught and thus will not
                    373:      be relayed to the command.  As a general rule, SIGTSTP should be used
1.1.1.3   misho     374:      instead of SIGSTOP when you wish to suspend a command being run by ssuuddoo.
                    375: 
                    376:      As a special case, ssuuddoo will not relay signals that were sent by the
                    377:      command it is running.  This prevents the command from accidentally
                    378:      killing itself.  On some systems, the reboot(1m) command sends SIGTERM to
1.1.1.4   misho     379:      all non-system processes other than itself before rebooting the system.
1.1.1.3   misho     380:      This prevents ssuuddoo from relaying the SIGTERM signal it received back to
                    381:      reboot(1m), which might then exit before the system was actually rebooted,
                    382:      leaving it in a half-dead state similar to single user mode.  Note,
                    383:      however, that this check only applies to the command run by ssuuddoo and not
                    384:      any other processes that the command may create.  As a result, running a
                    385:      script that calls reboot(1m) or shutdown(1m) via ssuuddoo may cause the system
                    386:      to end up in this undefined state unless the reboot(1m) or shutdown(1m) are
                    387:      run using the eexxeecc() family of functions instead of ssyysstteemm() (which
                    388:      interposes a shell between the command and the calling process).
1.1       misho     389: 
1.1.1.4   misho     390:      If no I/O logging plugins are loaded and the policy plugin has not
                    391:      defined a cclloossee() function, set a command timeout or required that the
                    392:      command be run in a new pty, ssuuddoo may execute the command directly
                    393:      instead of running it as a child process.
                    394: 
                    395:    PPlluuggiinnss
1.1.1.6 ! misho     396:      Plugins may be specified via Plugin directives in the sudo.conf(4) file.
        !           397:      They may be loaded as dynamic shared objects (on systems that support
        !           398:      them), or compiled directly into the ssuuddoo binary.  If no sudo.conf(4)
        !           399:      file is present, or it contains no Plugin lines, ssuuddoo will use the
        !           400:      traditional _s_u_d_o_e_r_s security policy and I/O logging.  See the
        !           401:      sudo.conf(4) manual for details of the _/_e_t_c_/_s_u_d_o_._c_o_n_f file and the
        !           402:      sudo_plugin(1m) manual for more information about the ssuuddoo plugin
        !           403:      architecture.
1.1.1.2   misho     404: 
1.1.1.3   misho     405: EEXXIITT VVAALLUUEE
                    406:      Upon successful execution of a program, the exit status from _s_u_d_o will
                    407:      simply be the exit status of the program that was executed.
1.1       misho     408: 
1.1.1.3   misho     409:      Otherwise, ssuuddoo exits with a value of 1 if there is a
                    410:      configuration/permission problem or if ssuuddoo cannot execute the given
                    411:      command.  In the latter case the error string is printed to the standard
                    412:      error.  If ssuuddoo cannot stat(2) one or more entries in the user's PATH, an
                    413:      error is printed on stderr.  (If the directory does not exist or if it is
                    414:      not really a directory, the entry is ignored and no error is printed.)
                    415:      This should not happen under normal circumstances.  The most common
                    416:      reason for stat(2) to return ``permission denied'' is if you are running
                    417:      an automounter and one of the directories in your PATH is on a machine
                    418:      that is currently unreachable.
1.1       misho     419: 
                    420: SSEECCUURRIITTYY NNOOTTEESS
1.1.1.3   misho     421:      ssuuddoo tries to be safe when executing external commands.
1.1       misho     422: 
1.1.1.3   misho     423:      To prevent command spoofing, ssuuddoo checks "." and "" (both denoting
                    424:      current directory) last when searching for a command in the user's PATH
                    425:      (if one or both are in the PATH).  Note, however, that the actual PATH
                    426:      environment variable is _n_o_t modified and is passed unchanged to the
                    427:      program that ssuuddoo executes.
                    428: 
                    429:      Please note that ssuuddoo will normally only log the command it explicitly
                    430:      runs.  If a user runs a command such as sudo su or sudo sh, subsequent
                    431:      commands run from that shell are not subject to ssuuddoo's security policy.
                    432:      The same is true for commands that offer shell escapes (including most
                    433:      editors).  If I/O logging is enabled, subsequent commands will have their
                    434:      input and/or output logged, but there will not be traditional logs for
                    435:      those commands.  Because of this, care must be taken when giving users
                    436:      access to commands via ssuuddoo to verify that the command does not
                    437:      inadvertently give the user an effective root shell.  For more
                    438:      information, please see the _P_R_E_V_E_N_T_I_N_G _S_H_E_L_L _E_S_C_A_P_E_S section in
                    439:      sudoers(4).
                    440: 
                    441:      To prevent the disclosure of potentially sensitive information, ssuuddoo
                    442:      disables core dumps by default while it is executing (they are re-enabled
                    443:      for the command that is run).  To aid in debugging ssuuddoo crashes, you may
                    444:      wish to re-enable core dumps by setting ``disable_coredump'' to false in
1.1.1.4   misho     445:      the sudo.conf(4) file as follows:
1.1.1.3   misho     446: 
                    447:            Set disable_coredump false
                    448: 
1.1.1.4   misho     449:      See the sudo.conf(4) manual for more information.
1.1.1.2   misho     450: 
1.1       misho     451: EENNVVIIRROONNMMEENNTT
1.1.1.3   misho     452:      ssuuddoo utilizes the following environment variables.  The security policy
                    453:      has control over the actual content of the command's environment.
1.1       misho     454: 
1.1.1.3   misho     455:      EDITOR           Default editor to use in --ee (sudoedit) mode if neither
                    456:                       SUDO_EDITOR nor VISUAL is set.
1.1       misho     457: 
1.1.1.3   misho     458:      MAIL             In --ii mode or when _e_n_v___r_e_s_e_t is enabled in _s_u_d_o_e_r_s, set
                    459:                       to the mail spool of the target user.
1.1       misho     460: 
1.1.1.3   misho     461:      HOME             Set to the home directory of the target user if --ii or --HH
                    462:                       are specified, _e_n_v___r_e_s_e_t or _a_l_w_a_y_s___s_e_t___h_o_m_e are set in
                    463:                       _s_u_d_o_e_r_s, or when the --ss option is specified and _s_e_t___h_o_m_e
                    464:                       is set in _s_u_d_o_e_r_s.
1.1       misho     465: 
1.1.1.3   misho     466:      PATH             May be overridden by the security policy.
1.1       misho     467: 
1.1.1.3   misho     468:      SHELL            Used to determine shell to run with --ss option.
1.1       misho     469: 
1.1.1.3   misho     470:      SUDO_ASKPASS     Specifies the path to a helper program used to read the
                    471:                       password if no terminal is available or if the --AA option
                    472:                       is specified.
1.1       misho     473: 
1.1.1.3   misho     474:      SUDO_COMMAND     Set to the command run by sudo.
1.1       misho     475: 
1.1.1.3   misho     476:      SUDO_EDITOR      Default editor to use in --ee (sudoedit) mode.
1.1       misho     477: 
1.1.1.3   misho     478:      SUDO_GID         Set to the group ID of the user who invoked sudo.
1.1       misho     479: 
1.1.1.3   misho     480:      SUDO_PROMPT      Used as the default password prompt.
1.1       misho     481: 
1.1.1.3   misho     482:      SUDO_PS1         If set, PS1 will be set to its value for the program
                    483:                       being run.
1.1       misho     484: 
1.1.1.3   misho     485:      SUDO_UID         Set to the user ID of the user who invoked sudo.
1.1       misho     486: 
1.1.1.3   misho     487:      SUDO_USER        Set to the login name of the user who invoked sudo.
1.1       misho     488: 
1.1.1.3   misho     489:      USER             Set to the target user (root unless the --uu option is
                    490:                       specified).
1.1       misho     491: 
1.1.1.3   misho     492:      VISUAL           Default editor to use in --ee (sudoedit) mode if
                    493:                       SUDO_EDITOR is not set.
1.1       misho     494: 
                    495: FFIILLEESS
1.1.1.3   misho     496:      _/_e_t_c_/_s_u_d_o_._c_o_n_f            ssuuddoo front end configuration
1.1       misho     497: 
                    498: EEXXAAMMPPLLEESS
1.1.1.3   misho     499:      Note: the following examples assume a properly configured security
                    500:      policy.
1.1       misho     501: 
1.1.1.3   misho     502:      To get a file listing of an unreadable directory:
1.1       misho     503: 
1.1.1.3   misho     504:            $ sudo ls /usr/local/protected
1.1       misho     505: 
1.1.1.3   misho     506:      To list the home directory of user yaz on a machine where the file system
                    507:      holding ~yaz is not exported as root:
1.1       misho     508: 
1.1.1.3   misho     509:            $ sudo -u yaz ls ~yaz
1.1       misho     510: 
1.1.1.3   misho     511:      To edit the _i_n_d_e_x_._h_t_m_l file as user www:
1.1       misho     512: 
1.1.1.3   misho     513:            $ sudo -u www vi ~www/htdocs/index.html
1.1       misho     514: 
1.1.1.3   misho     515:      To view system logs only accessible to root and users in the adm group:
1.1       misho     516: 
1.1.1.3   misho     517:            $ sudo -g adm view /var/log/syslog
1.1       misho     518: 
1.1.1.3   misho     519:      To run an editor as jim with a different primary group:
1.1       misho     520: 
1.1.1.3   misho     521:            $ sudo -u jim -g audio vi ~jim/sound.txt
1.1       misho     522: 
1.1.1.3   misho     523:      To shut down a machine:
1.1       misho     524: 
1.1.1.3   misho     525:            $ sudo shutdown -r +15 "quick reboot"
1.1       misho     526: 
1.1.1.3   misho     527:      To make a usage listing of the directories in the /home partition.  Note
                    528:      that this runs the commands in a sub-shell to make the cd and file
                    529:      redirection work.
1.1       misho     530: 
1.1.1.3   misho     531:            $ sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"
1.1       misho     532: 
                    533: SSEEEE AALLSSOO
1.1.1.4   misho     534:      su(1), stat(2), login_cap(3), passwd(4), sudo.conf(4), sudoers(4),
1.1.1.3   misho     535:      sudo_plugin(1m), sudoreplay(1m), visudo(1m)
1.1       misho     536: 
1.1.1.3   misho     537: HHIISSTTOORRYY
                    538:      See the HISTORY file in the ssuuddoo distribution
                    539:      (http://www.sudo.ws/sudo/history.html) for a brief history of sudo.
1.1       misho     540: 
1.1.1.3   misho     541: AAUUTTHHOORRSS
                    542:      Many people have worked on ssuuddoo over the years; this version consists of
                    543:      code written primarily by:
1.1       misho     544: 
1.1.1.3   misho     545:            Todd C. Miller
1.1.1.2   misho     546: 
1.1.1.3   misho     547:      See the CONTRIBUTORS file in the ssuuddoo distribution
                    548:      (http://www.sudo.ws/sudo/contributors.html) for an exhaustive list of
                    549:      people who have contributed to ssuuddoo.
1.1       misho     550: 
                    551: CCAAVVEEAATTSS
1.1.1.3   misho     552:      There is no easy way to prevent a user from gaining a root shell if that
                    553:      user is allowed to run arbitrary commands via ssuuddoo.  Also, many programs
                    554:      (such as editors) allow the user to run commands via shell escapes, thus
                    555:      avoiding ssuuddoo's checks.  However, on most systems it is possible to
                    556:      prevent shell escapes with the sudoers(4) plugin's _n_o_e_x_e_c functionality.
                    557: 
                    558:      It is not meaningful to run the cd command directly via sudo, e.g.,
                    559: 
                    560:            $ sudo cd /usr/local/protected
                    561: 
                    562:      since when the command exits the parent process (your shell) will still
                    563:      be the same.  Please see the _E_X_A_M_P_L_E_S section for more information.
                    564: 
                    565:      Running shell scripts via ssuuddoo can expose the same kernel bugs that make
                    566:      setuid shell scripts unsafe on some operating systems (if your OS has a
                    567:      /dev/fd/ directory, setuid shell scripts are generally safe).
1.1       misho     568: 
                    569: BBUUGGSS
1.1.1.3   misho     570:      If you feel you have found a bug in ssuuddoo, please submit a bug report at
                    571:      http://www.sudo.ws/sudo/bugs/
1.1       misho     572: 
                    573: SSUUPPPPOORRTT
1.1.1.3   misho     574:      Limited free support is available via the sudo-users mailing list, see
                    575:      http://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search the
                    576:      archives.
1.1       misho     577: 
                    578: DDIISSCCLLAAIIMMEERR
1.1.1.3   misho     579:      ssuuddoo is provided ``AS IS'' and any express or implied warranties,
                    580:      including, but not limited to, the implied warranties of merchantability
                    581:      and fitness for a particular purpose are disclaimed.  See the LICENSE
                    582:      file distributed with ssuuddoo or http://www.sudo.ws/sudo/license.html for
                    583:      complete details.
1.1       misho     584: 
1.1.1.6 ! misho     585: Sudo 1.8.10                    February 15, 2014                   Sudo 1.8.10

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>