S6-SETUIDGID(8)
π s6-setuidgid (section 8, System Manager's Manual) π
okay bestie, quick vibe check: this is s6-setuidgid, and honestly? it's giving backstage pass energy. it's the little tool that walks a program into the club as somebody else entirely. π
β¨ SYNOPSIS β¨
s6-setuidgid account prog...
that's it. that's the whole wig. account first, then whatever prog... you want it to become. π
πΈ DESCRIPTION πΈ
so here's the tea, and you're gonna want to sip it slowly because account has three whole moods:
- if
accountis the empty string, thens6-setuidgidstraight-upexec(3)s intoprog...with zero state changes. no glow-up, no costume change, just β¨ directly into it β¨. literally nothing about you gets altered. - if
accounthas a colon in it, it gets read asuid:gidβ raw numbers, no name lookup, iykyk. π - otherwise? it's a username, and it gets looked up by name in the account database. classic.
if account is unknown, s6-setuidgid exits 1. that's the unhappy ending, bestie π β no program gets executed, it just bails.
assuming the lookup worked, s6-setuidgid sets its (real and effective) uid and gid to those of account. yup, both. π
it also sets the list of supplementary groups to the correct one for account, according to the group database. so your group memberships match too β no leftovers from the old you. it's giving full transformation montage π¦
then it executes into prog.... π
β οΈ real talk though: unlessaccountis empty,s6-setuidgidcan only be run as root. no cap. it needs that power to give it away.
and that's literally its whole main-character purpose: dropping root privileges before starting a daemon. π«Ά the icon, the legend, the privilege-dropper. periodt.
π¦ SEE ALSO π¦
the whole friend group, obviously:
s6-applyuidgid(8)s6-envdir(8)s6-envuidgid(8)s6-fghack(8)s6-setsid(8)s6-softlimit(8)s6-tai64n(8)s6-tai64nlocal(8)
this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-setuidgid.html β go read the source, it's the blueprint π§
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
anyway bestie, that's the page π Debian, January 15, 2023 β stay safe, drop those privileges, and remember: with great root comes great responsibility. slay π π₯
π¦ where this page comes from
- nixpkgs unstable: s6 2.15.1.0
- nixpkgs unstable: s6-man-pages 2.14.0.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms