setuidgid(8)

πŸ“¦
version 0.76 Β· 2 versions
  • 0.76 Β· debian bookworm, debian trixie, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.11 Β· alpine 3.24
, in debian bookworm, debian trixie, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

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

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