s6-setuidgid.html (1736B)
1 <html> 2 <head> 3 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <meta http-equiv="Content-Language" content="en" /> 6 <title>s6: the s6-setuidgid program</title> 7 <meta name="Description" content="s6: the s6-setuidgid program" /> 8 <meta name="Keywords" content="s6 command s6-setuidgid uid gid groups privilege dropping loss user change su" /> 9 <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> --> 10 </head> 11 <body> 12 13 <p> 14 <a href="index.html">s6</a><br /> 15 <a href="//skarnet.org/software/">Software</a><br /> 16 <a href="//skarnet.org/">skarnet.org</a> 17 </p> 18 19 <h1> The s6-setuidgid program </h1> 20 21 <p> 22 s6-setuidgid executes a program as another user. 23 </p> 24 25 <h2> Interface </h2> 26 27 <pre> 28 s6-setuidgid <em>account</em> <em>prog...</em> 29 </pre> 30 31 <ul> 32 <li> If <em>account</em> is the empty string, then s6-setuidgid directly execs 33 into <em>prog...</em> without any state changes. </li> 34 <li> If <em>account</em> contains a colon, it is interpreted as <em>uid:gid</em>, 35 else it is interpreted as a username and looked up by name in the account 36 database. </li> 37 <li> If <em>account</em> is unknown, s6-setuidgid exits 1. </li> 38 <li> s6-setuidgid sets its (real and effective) uid and gid to those of <em>account</em>. 39 It also sets the list of supplementary groups to the correct one for <em>account</em> 40 according to the group database. </li> 41 <li> Then it executes into <em>prog...</em>. </li> 42 </ul> 43 44 <h2> Notes </h2> 45 46 <ul> 47 <li> Unless <em>account</em> is empty, s6-setuidgid can only be run as root. Its main use 48 is to drop root privileges before starting a daemon. </li> 49 </ul> 50 51 </body> 52 </html>