[sudo-users] Prompted for password when NOPASSWD specified

Martin Schröder martin at oneiros.de
Wed Feb 29 15:39:35 EST 2012


2012/2/29 Boxall, John <john.boxall at bmo.com>:
> On a RHEL 5.6 system with sudo 1.7.2p1 we are experiencing unexpected behaviour when attempting "sudo /bin/su - user1".

man sudo:
       -i [command]
                   The -i (simulate initial login) option runs the
shell specified in the passwd(5) entry of
                   the target user as a login shell.  This means that
login-specific resource files such as
                   .profile or .login will be read by the shell.  If a
command is specified, it is passed to
                   the shell for execution.  Otherwise, an interactive
shell is executed.  sudo attempts to
                   change to that user's home directory before running
the shell.  It also initializes the
                   environment, leaving TERM unchanged, setting HOME,
MAIL, SHELL, USER, LOGNAME, and PATH, as
                   well as the contents of /etc/environment on Linux
and AIX systems.  All other environment
                   variables are removed.

       -s [command]
                   The -s (shell) option runs the shell specified by
the SHELL environment variable if it is
                   set or the shell as specified in passwd(5).  If a
command is specified, it is passed to the
                   shell for execution.  Otherwise, an interactive
shell is executed.

Best
   Martin



More information about the sudo-users mailing list