S6-SETUIDGID(8)

πŸ“¦ version 2.15.1.0, in nixpkgs unstable

πŸ’… 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 account is the empty string, then s6-setuidgid straight-up exec(3)s into prog... with zero state changes. no glow-up, no costume change, just ✨ directly into it ✨. literally nothing about you gets altered.
  • if account has a colon in it, it gets read as uid: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: unless account is empty, s6-setuidgid can 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:

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