1 .TH NSENTER 1 "June 2013" "util-linux" "User Commands"
3 nsenter \- run program with namespaces of other processes
10 Enters the namespaces of one or more other processes and then executes the specified
11 program. Enterable namespaces are:
14 Mounting and unmounting filesystems will not affect the rest of the system
16 flag), except for filesystems which are explicitly marked as shared (with
17 \fBmount --make-\:shared\fP; see \fI/proc\:/self\:/mountinfo\fP for the
21 Setting hostname or domainname will not affect the rest of the system.
26 The process will have an independent namespace for System V message queues,
27 semaphore sets and shared memory segments.
32 The process will have independent IPv4 and IPv6 stacks, IP routing tables,
37 directory trees, sockets, etc.
42 Children will have a set of PID to process mappings separate from the
48 will fork by default if changing the PID namespace, so that the new program
49 and its children share the same PID namespace and are visible to each other.
50 If \fB\-\-no\-fork\fP is used, the new program will be exec'ed without forking.
53 The process will have a distinct set of UIDs, GIDs and capabilities.
57 See \fBclone\fP(2) for the exact semantics of the flags.
59 If \fIprogram\fP is not given, then ``${SHELL}'' is run (default: /bin\:/sh).
63 \fB\-t\fR, \fB\-\-target\fR \fIpid\fP
64 Specify a target process to get contexts from. The paths to the contexts
72 /proc/\fIpid\fR/ns/mnt
75 /proc/\fIpid\fR/ns/uts
78 /proc/\fIpid\fR/ns/ipc
81 /proc/\fIpid\fR/ns/net
84 /proc/\fIpid\fR/ns/pid
87 /proc/\fIpid\fR/ns/user
94 the working directory respectively
98 \fB\-m\fR, \fB\-\-mount\fR[=\fIfile\fR]
99 Enter the mount namespace. If no file is specified, enter the mount namespace
100 of the target process. If file is specified, enter the mount namespace
103 \fB\-u\fR, \fB\-\-uts\fR[=\fIfile\fR]
104 Enter the UTS namespace. If no file is specified, enter the UTS namespace of
105 the target process. If file is specified, enter the UTS namespace specified by
108 \fB\-i\fR, \fB\-\-ipc\fR[=\fIfile\fR]
109 Enter the IPC namespace. If no file is specified, enter the IPC namespace of
110 the target process. If file is specified, enter the IPC namespace specified by
113 \fB\-n\fR, \fB\-\-net\fR[=\fIfile\fR]
114 Enter the network namespace. If no file is specified, enter the network
115 namespace of the target process. If file is specified, enter the network
116 namespace specified by file.
118 \fB\-p\fR, \fB\-\-pid\fR[=\fIfile\fR]
119 Enter the PID namespace. If no file is specified, enter the PID namespace of
120 the target process. If file is specified, enter the PID namespace specified by
123 \fB\-U\fR, \fB\-\-user\fR[=\fIfile\fR]
124 Enter the user namespace. If no file is specified, enter the user namespace of
125 the target process. If file is specified, enter the user namespace specified by
126 file. See also the \fB\-\-setuid\fR and \fB\-\-setgid\fR options.
128 \fB\-G\fR, \fB\-\-setgid\fR \fIgid\fR
129 Set the group ID which will be used in the entered namespace and drop
130 supplementary groups.
132 always sets GID for user namespaces, the default is 0.
134 \fB\-S\fR, \fB\-\-setuid\fR \fIuid\fR
135 Set the user ID which will be used in the entered namespace.
137 always sets UID for user namespaces, the default is 0.
139 \fB\-\-preserve\-credentials\fR
140 Don't modify UID and GID when enter user namespace. The default is to
141 drops supplementary groups and sets GID and UID to 0.
143 \fB\-r\fR, \fB\-\-root\fR[=\fIdirectory\fR]
144 Set the root directory. If no directory is specified, set the root directory to
145 the root directory of the target process. If directory is specified, set the
146 root directory to the specified directory.
148 \fB\-w\fR, \fB\-\-wd\fR[=\fIdirectory\fR]
149 Set the working directory. If no directory is specified, set the working
150 directory to the working directory of the target process. If directory is
151 specified, set the working directory to the specified directory.
153 \fB\-F\fR, \fB\-\-no\-fork\fR
154 Do not fork before exec'ing the specified program. By default, when entering a
155 PID namespace, \fBnsenter\fP calls \fBfork\fP before calling \fBexec\fP so that
156 any children will also be in the newly entered PID namespace.
158 \fB\-V\fR, \fB\-\-version\fR
159 Display version information and exit.
161 \fB\-h\fR, \fB\-\-help\fR
162 Display help text and exit.
167 .MT ebiederm@xmission.com
171 The nsenter command is part of the util-linux package and is available from
172 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/