16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

su<br />

v Changes the group ID. If a user ID is specified, the group ID is changed to that<br />

of the specified user’s default group GID.<br />

If a user ID is specified, the supplementary group list is changed to that of the<br />

specified user.<br />

If the change of group ID or supplemental group list fails, the su command<br />

issues a message and continues.<br />

v Changes the user ID. Your user ID may be changed to either the specified user<br />

ID or the superuser’s user ID (UID 0).<br />

– When a user ID is specified, your MVS identity changes to the specified user<br />

ID, changing your access authority for MVS data sets in addition to changing<br />

to the new user’s UID.<br />

– When a user ID is not specified, your MVS identity remains the same. This<br />

maintains your access authority to MVS data sets, while gaining superuser<br />

authority.<br />

– If you are already running under UID 0 and BPX.DAEMON is defined, issuing<br />

su with no userid will result in your UID being switched to BPXROOT. If<br />

BPX.DAEMON is not defined, and you issue su with the userid while running<br />

under UID 0, your UID will remain set to 0. In both cases, access to the<br />

BPX.SUPERUSER resource in the FACILITY class will not be checked.<br />

v Sets up the shell environment.<br />

If the login shell (’–’ flag) is specified, the OMVS segment of the new user is<br />

used to set up the shell environment, similar to user login processing. This<br />

includes setting the SHELL, HOME, and LOGNAME environment variables.<br />

PATH is set to the system default (/bin), TERM is preserved from the current<br />

environment, and STEPLIB is set to ″none″. Other environment variables are not<br />

inherited by the new shell.<br />

If the login shell is not specified, the OMVS segment of your user profile is used<br />

to set up the shell environment. The environment is set up to be as similar as<br />

possible to the environment of the shell issuing the su command. Existing values<br />

of HOME, LOGNAME, and PATH are preserved. If not set in the current shell<br />

environment, HOME and LOGNAME are set from the calling user’s profile, and<br />

PATH is set to the system default (/bin). SHELL is set to calling user’s profile<br />

value, or the default /bin/sh, if not defined.<br />

v Executes the new shell. If login shell (’–’ flag) is specified, prepend ’–’ to the<br />

shell’s name. This indicates that the shell should read its login startup files (for<br />

example, /bin/sh will read /etc/profile and $HOME/.profile). The new shell is<br />

initialized to run as a child process of the shell issuing the su command. If the su<br />

command is run from a restricted shell (such as a shell that was started with the<br />

–r option), you will exit from the restricted shell and leave the protection of the<br />

trusted environment.<br />

Notes:<br />

1. The new shell is always run in a new address space, even if you have<br />

_BPX_SHAREAS=YES set.<br />

2. If you use the OMVS interface when running a shell created by su, any<br />

attempt to execute TSO commands (PF6) results in the command running<br />

back in your TSO address space. When these TSO commands run, they run<br />

with your TSO identity, not the identity specified by su.<br />

608 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference<br />

However, if you are not using the OMVS interface (for example, you rlogin or<br />

telnet into the shell), you cannot use PF6 to execute a TSO command, and,<br />

as a result, there will be no TSO address space or identity. The alternative<br />

solution is to use tso –t which allows you to run a TSO/E command with the<br />

current identity set by su.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!