cross-unix-documentationdocumentation of similarities and (noteworthy) differencies between Unix systems
Author: Haelwenn (lanodan) Monnier <firstname.lastname@example.org>
Date: Wed, 6 Mar 2019 06:21:32 +0100
man1x/su.1x: New manpage
1 file changed, 75 insertions(+), 0 deletions(-)
diff --git a/man1x/su.1x b/man1x/su.1x
@@ -0,0 +1,75 @@
+.\" This file is part of Cross Unix Documentation
+.\" Copyright © 2019 Haelwenn (lanodan) Monnier <email@example.com>
+.\" SPDX-License-Identifier: CC-BY-4.0
+.Dt SU 1x
+This manual page is part of
+.Lk https://hacktivis.me/git/cross-unix-documentation "Cross-Unix Documentation"
+which is an attempt to provide documentation of similarities and (noteworthy) differencies between Unix-like systems. To be used as an addition to the POSIX standard.
+.Nd switch user / become superuser
+.Op Fl plm
+.Op Fl c Ar command
+.Op Fl s Ar shell
+.Op username Op shell arguments
+utility is used to run a command or get a shell as another user, without having to log out.
+By default the environment is unmodified with the exception of LOGNAME, HOME, SHELL, and USER.
+HOME and SHELL are set to the target user’s default values. LOGNAME and USER are set to the target user, unless the target user has a UID of 0 and
+was not specified, in which case it is unmodified. The invoked shell is the target user’s. This is the traditional behaviour of su.
+If not using
+and the target login has a UID of 0 then the PATH variable and umask are set to implementation defined behaviour.
+was not set it defaults to UID 0 (also known as Super-User).
+.Bl -tag -width Ds
+.It - , Fl l
+Simulate a full login, this discards the origin user’s environment, expect for few implementation defined ones (like TERM). Absent in BusyBox.
+.It Fl c Ar command
+as the target user. This flag is used for "login class" in
+where you must pass the command by appending it to the end, along with the target user’s username.
+.It Fl p , Fl m
+Preserve the environment, few exceptions are present between implementations.
+GNU: preserve expect for PATH and IFS
+.It Fl s Ar shell
+Login to target user with
+instead of their default one. This is absent in
+.It Op shell arguments
+Executes the remaining
+.Op shell arguments
+in the target user's shell non-interactively. This seems to be absent in Busybox.
+GNU coreutils 8.30, Busybox 1.30.1,
+.Ox 6.4 ,
+.Nx 8.0 ,
+.Sh SEE ALSO
+.Xr sudo 1 ,
+.Xr doas 1 ,
+.Xr login 1 ,
+.Xr environ 7 .
+command appeared in
+.At v7 .
+.An Haelwenn (lanodan) Monnier Aq Mt firstname.lastname@example.org