setuser(8)
π setuser(8) β your fave System Manager's Manual girlie π
okay so this one is from the System Manager's Manual, and it's literally the βrun someone else's program as someone elseβ tool. bestie, it is root-only, no cap.
πΈ NAME πΈ
setuser β runs another program under a specified account's environment.
β¨ SYNOPSIS β¨
setuser account child
π¦ DESCRIPTION π¦
So account is a single argument. child consists of one or more arguments. slay, simple.
setuser sets $GID, $UID, $SHELL, $HOME, and $USER to account's gid number, uid number, login shell, home directory, and user name, respectively. it's giving very βmatch the account, match the vibeβ energy.
It changes the working directory to account's home, and sets its uid and gid to account's uid and gid, with supplementary groups set up. then it runs child. iconic behavior, honestly.
β οΈ setuser cannot be run by anyone other than root. like, do not try it as a regular user, bestie β it's not gonna be the moment you think it is. π
π EXIT CODES π
setuser exits 111 if it cannot find a UNIX account named account, if it cannot setup the environment, change directory, setgid, setuid, or run child. otherwise its exit code is the same as that of child. periodt.
π SEE ALSO π
the whole friend group, fr fr:
envdir(8)envini(8)envuidgid(8)fghack(8)multilog(8)pgrphack(8)readproctitle(8)setlock(8)setuidgid(8)softlimit(8)supervise(8)svc(8)svok(8)svscan(8)svscanboot(8)svstat(8)tai64n(8)tai64nlocal(8)
signing off from the System Manager's Manual, setuser(8) β no date on this footer bestie, it's giving timeless π«Άπβ¨
π¦ where this page comes from
- alpine 3.24: daemontools-encore-doc 1.11-r3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms