logo

skeud

Simple and portable utilities to deal with user accounts (su, login)
commit: 7f1abfe6e7a9957754581f551ab865626d8b3f6f
parent baa0af5f8d7aa2c51d6ab068e664086604f1b504
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 11 Sep 2023 09:02:29 +0200

su.1: New manpage

Diffstat:

Asu.170++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+), 0 deletions(-)

diff --git a/su.1 b/su.1 @@ -0,0 +1,70 @@ +.\" 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