su.1 (2010 09)
s
su(1) su(1)
If the shell specified in
/etc/passwd is /usr/bin/sh, su sets the value of parameter 0 in the new
shell (referenced as
$0)tosu
. If the - option of the su command is specified, su sets parameter 0 to
-su.
If the shell specified in
/etc/passwd
is not /usr/bin/sh, su sets the value of parameter 0 in the
new shell to shellname . If the
-
option of the su command is specified, su sets parameter 0 to
-shellname. For example, if the Korn shell is invoked, the value of shellname will be either
ksh or
-ksh.
By comparison, the
login command always sets parameter
0 to -shellname.
HP-UX Smart Card Login
If the user account is configured to use a Smart Card, the user password is stored in the card. This pass-
word has characteristics identical to a normal password stored on the system.
In order to
su using a Smart Card account, the Smart Card from the destination user account must be
inserted into the Smart Card reader. The user is prompted for a PIN instead of a password during
authentication.
Enter PIN:
The password is retrieved automatically from the Smart Card when a valid PIN is entered. Therefore, it
is not necessary to know the password, only the PIN.
The card is locked if an incorrect PIN is entered three consecutive times. It may be unlocked only by the
card issuer.
SECURITY FEATURES
Except for user root, users cannot use su to change to an account that has been locked because of
expired passwords or other access restrictions.
Refer to the
/etc/default/security
file in the security (4) manual page for detailed information on
configurable attributes that affect the behavior of this command. Currently, the supported attributes for
the
su command are:
SU_ROOT_GROUP
SU_DEFAULT_PATH
SU_KEEP_ENV_VARS
UMASK
EXTERNAL INFLUENCES
Environment Variables
HOME User’s home directory
LANG The language in which messages are displayed. If LANG is not specified or is null, it
defaults to C (see lang (5)). If any internationalization variable contains an invalid set-
ting, all internationalization variables default to C (see environ (5)).
LOGNAME User’s login name
PATH Command name search path
PS1 Default prompt
SHELL Name of the user’s shell
International Code Set Support
Characters in the 7-bit US-ASCII code sets are supported in login names (see ascii (5)).
EXAMPLES
Become user
bin while retaining the previously exported environment:
su bin
Become user bin but change the environment to what would be expected if bin had originally logged in:
su - bin
Execute the command, ’echo hello’, using the temporary environment and permissions of user bin.
In this example, user bin’s shell is invoked with the arguments -c ’echo hello’.
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010