s6

Mirror/fork of https://skarnet.org/software/s6/
git clone https://ccx.te2000.cz/git/s6
Log | Files | Refs | README | LICENSE

s6-applyuidgid.html (2391B)


      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-applyuidgid program</title>
      7     <meta name="Description" content="s6: the s6-applyuidgid program" />
      8     <meta name="Keywords" content="s6 command s6-applyuidgid 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-applyuidgid program </h1>
     20 
     21 <p>
     22  s6-applyuidgid executes a program with reduced privileges.
     23 </p>
     24 
     25 <h2> Interface </h2>
     26 
     27 <pre>
     28      s6-applyuidgid [ -z ] [ -u <em>uid</em> ] [ -g <em>gid</em> ] [ -G <em>gidlist</em> ] [ -U ] <em>prog...</em>
     29 </pre>
     30 
     31 <ul>
     32  <li> s6-applyuidgid sets its uid, gid and supplementary group list to the
     33 values given, then executes into <em>prog</em>. </li>
     34 </ul>
     35 
     36 <h2> Options </h2>
     37 
     38 <ul>
     39  <li> <tt>-u&nbsp;<em>uid</em></tt>&nbsp;: set the process' user ID to <em>uid</em> </li>
     40  <li> <tt>-g&nbsp;<em>gid</em></tt>&nbsp;: set the process' group ID to <em>gid</em> </li>
     41  <li> <tt>-G&nbsp;<em>gidlist</em></tt>&nbsp;: set the process' supplementary group list
     42 to <em>gidlist</em>, which must be given as a comma-separated list of numeric GIDs,
     43 without spaces. </li>
     44  <li> <tt>-U</tt>&nbsp;: set the process' user ID, group ID and supplementary group list
     45 to the values of the UID, GID and GIDLIST environment variables. If a <tt>-u</tt>,
     46 <tt>-g</tt> or <tt>-G</tt> option is given after <tt>-U</tt>, the command line
     47 value overrides the environment variable. </li>
     48  <li> <tt>-z</tt>&nbsp;: unexport. The UID, GID and GIDLIST variables will be
     49 removed from the process environment. </li>
     50 </ul>
     51 	
     52 <h2> Notes </h2>
     53 
     54 <ul>
     55  <li> s6-applyuidgid can only be run as root. Its main use is to drop root privileges before
     56 starting a daemon. </li>
     57  <li> s6-applyuidgid is a more generic version of
     58 <a href="s6-setuidgid.html">s6-setuidgid</a>. It is used as a command line
     59 building block by some programs that rewrite their command line, such as
     60 <a href="//skarnet.org/software/s6-networking/s6-tcpserver.html">s6-tcpserver</a>. </li>
     61 </ul>
     62 
     63 </body>
     64 </html>