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.
58 The process will have a virtualized view of \fI/proc\:/self\:/cgroup\fP, and new
59 cgroup mounts will be rooted at the namespace cgroup root.
60 .RB ( CLONE_\:NEWCGROUP
63 See \fBclone\fP(2) for the exact semantics of the flags.
65 If \fIprogram\fP is not given, then ``${SHELL}'' is run (default: /bin\:/sh).
69 \fB\-t\fR, \fB\-\-target\fR \fIpid\fP
70 Specify a target process to get contexts from. The paths to the contexts
78 /proc/\fIpid\fR/ns/mnt
81 /proc/\fIpid\fR/ns/uts
84 /proc/\fIpid\fR/ns/ipc
87 /proc/\fIpid\fR/ns/net
90 /proc/\fIpid\fR/ns/pid
93 /proc/\fIpid\fR/ns/user
96 /proc/\fIpid\fR/ns/cgroup
103 the working directory respectively
107 \fB\-m\fR, \fB\-\-mount\fR[=\fIfile\fR]
108 Enter the mount namespace. If no file is specified, enter the mount namespace
109 of the target process. If file is specified, enter the mount namespace
112 \fB\-u\fR, \fB\-\-uts\fR[=\fIfile\fR]
113 Enter the UTS namespace. If no file is specified, enter the UTS namespace of
114 the target process. If file is specified, enter the UTS namespace specified by
117 \fB\-i\fR, \fB\-\-ipc\fR[=\fIfile\fR]
118 Enter the IPC namespace. If no file is specified, enter the IPC namespace of
119 the target process. If file is specified, enter the IPC namespace specified by
122 \fB\-n\fR, \fB\-\-net\fR[=\fIfile\fR]
123 Enter the network namespace. If no file is specified, enter the network
124 namespace of the target process. If file is specified, enter the network
125 namespace specified by file.
127 \fB\-p\fR, \fB\-\-pid\fR[=\fIfile\fR]
128 Enter the PID namespace. If no file is specified, enter the PID namespace of
129 the target process. If file is specified, enter the PID namespace specified by
132 \fB\-U\fR, \fB\-\-user\fR[=\fIfile\fR]
133 Enter the user namespace. If no file is specified, enter the user namespace of
134 the target process. If file is specified, enter the user namespace specified by
135 file. See also the \fB\-\-setuid\fR and \fB\-\-setgid\fR options.
137 \fB\-C\fR, \fB\-\-cgroup\fR[=\fIfile\fR]
138 Enter the cgroup namespace. If no file is specified, enter the cgroup namespace of
139 the target process. If file is specified, enter the cgroup namespace specified by
142 \fB\-G\fR, \fB\-\-setgid\fR \fIgid\fR
143 Set the group ID which will be used in the entered namespace and drop
144 supplementary groups.
146 always sets GID for user namespaces, the default is 0.
148 \fB\-S\fR, \fB\-\-setuid\fR \fIuid\fR
149 Set the user ID which will be used in the entered namespace.
151 always sets UID for user namespaces, the default is 0.
153 \fB\-\-preserve\-credentials\fR
154 Don't modify UID and GID when enter user namespace. The default is to
155 drops supplementary groups and sets GID and UID to 0.
157 \fB\-r\fR, \fB\-\-root\fR[=\fIdirectory\fR]
158 Set the root directory. If no directory is specified, set the root directory to
159 the root directory of the target process. If directory is specified, set the
160 root directory to the specified directory.
162 \fB\-w\fR, \fB\-\-wd\fR[=\fIdirectory\fR]
163 Set the working directory. If no directory is specified, set the working
164 directory to the working directory of the target process. If directory is
165 specified, set the working directory to the specified directory.
167 \fB\-F\fR, \fB\-\-no\-fork\fR
168 Do not fork before exec'ing the specified program. By default, when entering a
169 PID namespace, \fBnsenter\fP calls \fBfork\fP before calling \fBexec\fP so that
170 any children will also be in the newly entered PID namespace.
172 \fB\-Z\fR, \fB\-\-follow\-context\fR
173 Set the SELinux security context used for executing a new process according to
174 already running process specified by \fB\-\-target\fR PID. (The util-linux has
175 to be compiled with SELinux support otherwise the option is unavailable.)
177 \fB\-V\fR, \fB\-\-version\fR
178 Display version information and exit.
180 \fB\-h\fR, \fB\-\-help\fR
181 Display help text and exit.
187 .UR biederm@xmission.com
195 The nsenter command is part of the util-linux package and is available from
196 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/