SUDO(1)
π SUDO(1) β the group chat version π
okay so bestie, you're reading the SUDO(1) page from section 1 of the manual (general commands, iykyk), and honestly? this one's a whole personality. it's sudo, but make it doas. let's get into it β¨
β¨ NAME β¨
sudo β execute a command as another user using doas. literally that's it, that's the vibe π¦
πΈ SYNOPSIS πΈ
sudo (-i | -s) [-k] [-n] [-u <user>] [<command> [--] [<args>...]]
sudo [-ikns] [-u <user>] <command> [--] [<args>...]
sudo -k
sudo [-h]
look at all those little bracket combos, she's giving options π
π¦ DESCRIPTION π¦
bestie, important lore first: this is NOT the original sudo(8). it's a shim for the sudo command that leans on doas(1) to do the actual work. no cap.
so what does it support? only a subset of the sudo(8) options (both short and long variants) that have an equivalent in doas(1), plus the extra-special options -i (--login) and -k (--reset-timestamp). that's the whole menu, nothing more π
if you want the real tea, go read doas(1) and sudo(8). they're the source material. π
π OPTIONS π
-i,--loginβ runs the shell listed in the target user's password database entry as a login shell. translation: login-specific resource files like.profile,.bash_profileor.loginget read by the shell. if you pass a command, it gets handed to the shell for execution via the shell's-coption. if you pass no command, you get an interactive shell. and this shim tries to change into that user's home directory right after running the shell π-k,--reset-timestampβ invalidates the user's cached credentials by runningdoas(1)with the-Loption. used with no command, it clears the cached credentials and just peaces out βοΈ
β οΈ WARNING: when you use this with a command, it's only an approximation, bestie. unlikesudo(8), OpenDoas can't ignore the cached credential for a single invocation while also preventing the timestamp from being refreshed. so this shim callsdoas -Lbefore and after the command instead β which is not atomic and may leave or expose a refreshed timestamp if it gets interrupted or used concurrently! π seriously, read that twice.
-n,--non-interactiveβ non-interactive mode: it fails if the matching rule doesn't have thenopassoption. no prompts, no small talk, just vibes and consequences π€-s,--shellβ runs the shell specified by theSHELLenvironment variable if it's set, or else the shell specified by the invoking user's password database entry. if you pass a command, it goes to the shell for execution via the shell's-coption. if you pass no command, you get an interactive shell π heads up though: most shells behave differently when a command is specified compared to an interactive session β so consult the shell's manual for the deets, i don't make the rules π-u<user>,--user<user>β run the command as a user other than the default target user (which is usuallyroot). the user can be either a user name or a numeric user-ID (UID). and here's the glow-up: unlike in the originalsudo(8), numeric UIDs don't have to be prefixed with the#character, and only UIDs listed in the password database are allowed π-h,--helpβ prints the help message and exits. the "i'm lost" button π«Ά
π FILES π
refer to doas(1). that's the whole section, she's short and mysterious π
π ENVIRONMENT π
this shim sets the following environment variables for compatibility with sudo(8). BUT β and this is the catch β they must be explicitly allowed in doas.conf(5) (using setenv or keepenv) to actually be exported into the created environment. no permission, no vibes π«
SUDO_GIDβ set to the group-ID of the user who invokedsudo.SUDO_UIDβ set to the user-ID of the user who invokedsudo.SUDO_USERβ set to the login name of the user who invokedsudo.
refer to doas(1) for more info, as always π§
β EXIT CODES β
refer to doas(1). yep, that's it, go look π
π AUTHORS π
Jakub Jirutka β the icon, the legend, the main character who wrote this π«‘
π REPORTING BUGS π
found a bug? report it to the project's issue tracker at https://github.com/jirutka/doas-sudo-shim/issues. don't just suffer in silence, bestie π
π₯ SEE ALSO π₯
the whole friend group, all here π
and that's the tea β β this page came from the 2026-06-09 build (that's the date, β¨ iconic β¨), so go forth and sudo responsibly, bestie. mwah ππ
π¦ where this page comes from
- alpine 3.24: doas-sudo-shim-doc 0.2.0-r0 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms