1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 2013 Eric W. Biederman
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
9 1. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14 3. The name of the copyright holders or contributors may not be used to
15 endorse or promote products derived from this software without
16 specific prior written permission.
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
31 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
32 <!-- SHADOW-CONFIG-HERE -->
35 <refentry id='newuidmap.1'>
37 <refentrytitle>newuidmap</refentrytitle>
38 <manvolnum>1</manvolnum>
39 <refmiscinfo class="sectdesc">User Commands</refmiscinfo>
40 <refmiscinfo class="source">shadow-utils</refmiscinfo>
41 <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
43 <refnamediv id='name'>
44 <refname>newuidmap</refname>
45 <refpurpose>set the uid mapping of a user namespace</refpurpose>
48 <refsynopsisdiv id='synopsis'>
50 <command>newuidmap</command>
52 <replaceable>pid</replaceable>
55 <replaceable>uid</replaceable>
58 <replaceable>loweruid</replaceable>
61 <replaceable>count</replaceable>
65 <replaceable>uid</replaceable>
68 <replaceable>loweruid</replaceable>
71 <replaceable>count</replaceable>
74 <replaceable>...</replaceable>
80 <refsect1 id='description'>
81 <title>DESCRIPTION</title>
83 The <command>newuidmap</command> sets <filename>/proc/[pid]/uid_map</filename> based on its
84 command line arguments and the uids allowed in <filename>/etc/subuid</filename>.
85 Note that the root user is not exempted from the requirement for a valid
86 <filename>/etc/subuid</filename> entry.
90 After the pid argument, <command>newuidmap</command> expects sets of 3 integers:
96 Beginning of the range of UIDs inside the user namespace.
101 <term>loweruid</term>
104 Beginning of the range of UIDs outside the user namespace.
112 Length of the ranges (both inside and outside the user namespace).
120 <command>newuidmap</command> verifies that the caller is the owner
121 of the process indicated by <option>pid</option> and that for each
122 of the above sets, each of the UIDs in the range [loweruid,
123 loweruid+count] is allowed to the caller according to
124 <filename>/etc/subuid</filename> before setting
125 <filename>/proc/[pid]/uid_map</filename>.
128 Note that newuidmap may be used only once for a given process.
132 <refsect1 id='options'>
133 <title>OPTIONS</title>
135 There currently are no options to the <command>newuidmap</command> command.
137 <variablelist remap='IP'>
141 <refsect1 id='files'>
145 <term><filename>/etc/subuid</filename></term>
147 <para>List of user's subordinate user IDs.</para>
151 <term><filename>/proc/[pid]/uid_map</filename></term>
153 <para>Mapping of uids from one between user namespaces.</para>
159 <refsect1 id='see_also'>
160 <title>SEE ALSO</title>
163 <refentrytitle>login.defs</refentrytitle><manvolnum>5</manvolnum>
166 <refentrytitle>newusers</refentrytitle><manvolnum>8</manvolnum>
169 <refentrytitle>subuid</refentrytitle><manvolnum>5</manvolnum>
172 <refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
175 <refentrytitle>usermod</refentrytitle><manvolnum>8</manvolnum>
178 <refentrytitle>userdel</refentrytitle><manvolnum>8</manvolnum>