From cd3d858aea5d085c09927ac04ddf8614ddad0b6e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 1 Feb 2024 11:53:37 +0100 Subject: [PATCH] su: (man) add hint about sessions Signed-off-by: Karel Zak --- login-utils/su.1.adoc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/login-utils/su.1.adoc b/login-utils/su.1.adoc index 76c54aa00f..8ae6b6ca6e 100644 --- a/login-utils/su.1.adoc +++ b/login-utils/su.1.adoc @@ -46,8 +46,15 @@ Specify the primary group. This option is available to the root user only. Specify a supplementary group. This option is available to the root user only. The first specified supplementary group is also used as a primary group if the option *--group* is not specified. *-*, *-l*, *--login*:: -Start the shell as a login shell with an environment similar to a real login: - +Start the shell as a login shell with an environment similar to a real login. ++ +Note that on systemd-based systems, a new session may be defined as a real +entry point to the system. However, *su* does not create a real session (by +PAM) from this point of view. You need to use tools like *systemd-run* or +*machinectl* to initiate a complete, real session. ++ +*su* does: ++ * clears all the environment variables except *TERM* and variables specified by *--whitelist-environment* * initializes the environment variables *HOME*, *SHELL*, *USER*, *LOGNAME*, and *PATH* * changes to the target user's home directory -- 2.47.3