SU(1) SU(1) su - - su [] [-] [ [...]] su - . , su . , , . , su HOME SHELL ( USER LOGNAME ). --login ( -) . su PAM , . su , , PAM-. su , (., ) ,,non-set-user-ID" runuser(1) PAM . PAM setpriv(1). su PAM (pam_getenvlist(3)) . --login --preserve-environment PAM-. 2.38 su RLIMIT_NICE, RLIMIT_RTPRIO, RLIMIT_FSIZE, RLIMIT_AS RLIMIT_NOFILE. -c, --command command -c. -f, --fast -f , , . -g, --group group . . -G, --supp-group group . . --group . -, -l, --login . systemd- , . , su (PAM-) . systemd-run machinectl , . su : o TERM --whitelist-environment o , , , -, o o ,,argv[0]" - -m, -p, --preserve-environment , . , , -. --login . -P, --pty Create a pseudo-terminal for the session. The independent terminal provides better security as the user does not share a terminal with the original session. This can be used to avoid TIOCSTI ioctl terminal injection and other security attacks against terminal file descriptors. The entire session can also be moved to the background (e.g., su --pty - user -c application &). If the pseudo-terminal is enabled, then su works as a proxy between the sessions (sync stdin and stdout). . , (., echo "" | su --pty), ECHO . -s, --shell shell . (. /etc/shells), --shell . , : o --shell o , --preserve-environment o o /bin/sh --session-command= -c, . ( .) -T, --no-pty , --pty -P. ,,TIOCSTI/TIOCLINUX ioctl". -w, --whitelist-environment list --login. , , , - . -h, --help . -V, --version Display version and exit. SIGINT, SIGQUIT SIGTERM, su . SIGTERM-, 2 SIGKILL-. su /etc/default/su /etc/login.defs . su: FAIL_DELAY () . - . ENV_PATH () . /usr/local/bin:/bin:/usr/bin. ENV_ROOTPATH (), ENV_SUPATH () . ENV_SUPATH . /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin. ALWAYS_SET_PATH () yes --login --preserve-environment runuser . /bin /sbin /usr; --login (., pam_env(8)). su . , su 128. su: 1 126 127 /etc/pam.d/su /etc/pam.d/su-l --login /etc/default/su ,,logindef" /etc/login.defs ,,logindef" , su btmp , lastlog . su PAM . pam_lastlog(8) pam_lastlog(8) lastlog . : session required pam_lastlog.so nowtmp su su ,,coreutils"-, . ,,util-linux"- . setpriv(1), login.defs(5), shells(5), pam(8), runuser(1) For bug reports, use the issue tracker . su ,,util-linux" . util-linux 2.41 2025-03-29 SU(1)