setuidgid(8)
π setuidgid(8) β the "run this as somebody else" glow-up π
okay bestie, welcome to the System Manager's Manual page for setuidgid, section 8 (that's the sysadmin section, the VIP lounge of manpages π). this is a tiny little tool with one job and it does it flawlessly, no cap.
β¨ NAME β¨
setuidgid β runs another program under a specified account's uid and gid.
like. it literally just. becomes somebody else and then runs your thing. main character energy, honestly π
πΈ SYNOPSIS πΈ
setuidgid account child
π¦ DESCRIPTION π¦
okay so listen. account is a single argument. one (1) of them. not a list, not a vibe, just the one.
child is one or more arguments β that's your program plus whatever you're handing it. the whole rest of the line, basically.
what setuidgid does is: it sets its own uid and gid to account's uid and gid, and it removes all supplementary groups while it's at it (yes, all of them, every single one, gone, bye π). then it runs child. that's it. that's the whole thing. it ate and left no crumbs.
π¨ and here's the important bit: setuidgid cannot be run by anyone other than root. not "shouldn't" β cannot. root only. if you're not root, this is not your moment, sorry bestie π
π EXIT CODES π
setuidgid exits 111 if any of these sad little things happen:
- it cannot find a UNIX account named
accountπ - it cannot
setgid - it cannot
setuid - it cannot run
child
otherwise? its exit code is exactly the same as that of child. it's a relay, not a narrator. it hands you the truth straight from your program, periodt π
π«Ά SEE ALSO π«Ά
the whole daemontools family reunion, go say hi:
supervise(8)svc(8)svok(8)svstat(8)svscanboot(8)svscan(8)readproctitle(8)fghack(8)pgrphack(8)multilog(8)tai64n(8)tai64nlocal(8)envuidgid(8)envdir(8)softlimit(8)setlock(8)
and the mothership herself: http://cr.yp.to/daemontools.html π
and that's the page, bestie!! it signs off at the bottom as setuidgid(8) β same name as the top, because it's just that iconic and it knows it. slay, go set some uids responsibly πβ¨
π¦ where this page comes from
- debian bookworm: daemontools 1:0.76-8.1 Β· LicenseRef-public-domain
- debian trixie: daemontools 1:0.76-14 Β· LicenseRef-public-domain
- nixpkgs unstable: daemontools 0.76
- ubuntu jammy: daemontools 1:0.76-7
- ubuntu noble: daemontools 1:0.76-10 Β· LicenseRef-public-domain
- ubuntu questing: daemontools 1:0.76-15
- ubuntu resolute: daemontools 1:0.76-15build1 Β· LicenseRef-public-domain
- ubuntu stonking: daemontools 1:0.76-15build1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms