setuser(8)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… 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:


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