summaryrefslogtreecommitdiff
path: root/doc/s6-setuidgid.html
blob: eb4e7f6eab1a79fd1584ad172f81ab4d40af4601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>s6: the s6-setuidgid program</title>
    <meta name="Description" content="s6: the s6-setuidgid program" />
    <meta name="Keywords" content="s6 command s6-setuidgid uid gid groups privilege dropping loss user change su" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">s6</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>

<h1> The s6-setuidgid program </h1>

<p>
s6-setuidgid executes a program as another user.
</p>

<h2> Interface </h2>

<pre>
     s6-setuidgid <em>account</em> <em>prog...</em>
</pre>

<ul>
 <li> If <em>account</em> is the empty string, then s6-setuidgid directly execs
into <em>prog...</em> without any state changes. </li>
 <li> If <em>account</em> contains a colon, it is interpreted as <em>uid:gid</em>,
else it is interpreted as a username and looked up by name in the account
database. </li>
 <li> If <em>account</em> is unknown, s6-setuidgid exits 1. </li>
 <li> s6-setuidgid sets its (real and effective) uid and gid to those of <em>account</em>.
It also sets the list of supplementary groups to the correct one for <em>account</em>
according to the group database. </li>
<li> Then it executes into <em>prog...</em>. </li>
</ul>

<h2> Notes </h2>

<ul>
 <li> Unless <em>account</em> is empty, s6-setuidgid can only be run as root. Its main use
is to drop root privileges before starting a daemon. </li>
</ul>

</body>
</html>