Originally posted by: Edward Davignon
sudo --login does not set the LOGIN envirnmont variable on AIX like the login process does.
$ rpm -q sudo
sudo-1.8.21p2-1.ppc
$ sudo --login env | grep '^LOG'
LOGNAME=root
$ sudo su - -c env | grep '^LOG'
LOGIN=root
LOGNAME=root
$ su - -c env | grep '^LOG'
root's Password:
LOGIN=root
LOGNAME=root
$ sudo --help | grep -e --login
-i, --login run login shell as the target user; a command may also be specified
$ man login | grep -p 'LOGIN .* environment variables'
When a user logs in successfully, the login command makes entries in the /etc/utmp file that
tracks current user logins and the /var/adm/wtmp file that is used for accounting purposes. The
login command also sets the LOGIN and LOGNAME environment variables.
$ oslevel -s
7200-02-02-1832
$ oslevel -sg $(oslevel -s)
Fileset Actual Level Service Pack Level
-----------------------------------------------------------------------------
devices.vdevice.IBM.vfc-client.rte 7.2.2.16 7.2.2.15
rsct.core.rmc 3.2.3.2 3.2.3.1
rsct.core.utils 3.2.3.2 3.2.3.1
rsct.opt.storagerm 3.2.3.2 3.2.3.1
$
#AIXOpenSource#AIX-Open-Source-Software