su.1 (1621B)
- .\" SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier <contact+skeud@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2023-09-10
- .Dt SU 1
- .Os
- .Sh NAME
- .Nm su
- .Nd switch user
- .Sh SYNOPSIS
- .Nm
- .Op Fl pl
- .Op Fl c Ar command
- .Op Fl s Ar shell
- .Op Fl
- .Op Ar username
- .Sh DESCRIPTION
- The
- .Nm
- utility allows to switch to another user.
- .Pp
- Regardless of any options, the following environment variables are always reset:
- .Ev HOME ,
- .Ev USER ,
- .Ev LOGNAME ,
- .Ev SHELL ,
- .Ev IFS .
- Note that while some other implementations will setup some values for
- .Ev PATH
- this utility considers it to be something for the shell to set.
- .Ss OPTIONS
- .Bl -tag -width Ds
- .It Fl p
- (Super-User only) Preserve environment, otherwise only
- .Ev TERM
- is kept.
- .It Fl l , Fl
- Provide a clean environment similar to what you would get with
- .Xr login 1 .
- Done via setting the current working directory to the target user home folder and passing the
- .Fl l
- flag to the shell.
- .Pp
- Note that the
- .Fl
- alias is only accepted as the last option flag.
- .It Fl c Ar command
- Command to run instead of interactive shell.
- .It Fl s Ar shell
- (Super-User only) Shell to use instead of shell entry in
- .Xr passwd 5 .
- .El
- .Sh EXIT STATUS
- If the user's shell is invoked, the exit status of
- .Nm
- shall be the exit status of the shell.
- Otherwise, the
- .Nm
- utility shall exit with one of the following values:
- .Bl -tag -width Ds
- .It 1
- An error occured or the authentication failed
- .It 126
- User's shell was found but couldn't be invoked.
- .It 127
- User's shell wasn't found.
- .El
- .Sh STANDARDS
- N/A
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+skeud@hacktivis.me