OSDN Git Service

util-linux 2.38: 翻訳予約。
[linuxjm/jm.git] / manual / util-linux / original / man1 / nsenter.1
1 '\" t
2 .\"     Title: nsenter
3 .\"    Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.15
5 .\"      Date: 2022-02-17
6 .\"    Manual: User Commands
7 .\"    Source: util-linux 2.38
8 .\"  Language: English
9 .\"
10 .TH "NSENTER" "1" "2022-02-17" "util\-linux 2.38" "User Commands"
11 .ie \n(.g .ds Aq \(aq
12 .el       .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 .  mso www.tmac
22 .  am URL
23 .    ad l
24 .  .
25 .  am MTO
26 .    ad l
27 .  .
28 .  LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 nsenter \- run program in different namespaces
32 .SH "SYNOPSIS"
33 .sp
34 \fBnsenter\fP [options] [\fIprogram\fP [\fIarguments\fP]]
35 .SH "DESCRIPTION"
36 .sp
37 The \fBnsenter\fP command executes \fIprogram\fP in the namespace(s) that are specified in the command\-line options (described below). If \fIprogram\fP is not given, then "${SHELL}" is run (default: \fI/bin/sh\fP).
38 .sp
39 Enterable namespaces are:
40 .sp
41 \fBmount namespace\fP
42 .RS 4
43 Mounting and unmounting filesystems will not affect the rest of the system, except for filesystems which are explicitly marked as shared (with \fBmount \-\-make\-shared\fP; see \fI/proc/self/mountinfo\fP for the \fBshared\fP flag). For further details, see \fBmount_namespaces\fP(7) and the discussion of the \fBCLONE_NEWNS\fP flag in \fBclone\fP(2).
44 .RE
45 .sp
46 \fBUTS namespace\fP
47 .RS 4
48 Setting hostname or domainname will not affect the rest of the system. For further details, see \fButs_namespaces\fP(7).
49 .RE
50 .sp
51 \fBIPC namespace\fP
52 .RS 4
53 The process will have an independent namespace for POSIX message queues as well as System V message queues, semaphore sets and shared memory segments. For further details, see \fBipc_namespaces\fP(7).
54 .RE
55 .sp
56 \fBnetwork namespace\fP
57 .RS 4
58 The process will have independent IPv4 and IPv6 stacks, IP routing tables, firewall rules, the \fI/proc/net\fP and \fI/sys/class/net\fP directory trees, sockets, etc. For further details, see \fBnetwork_namespaces\fP(7).
59 .RE
60 .sp
61 \fBPID namespace\fP
62 .RS 4
63 Children will have a set of PID to process mappings separate from the \fBnsenter\fP process. \fBnsenter\fP will fork by default if changing the PID namespace, so that the new program and its children share the same PID namespace and are visible to each other. If \fB\-\-no\-fork\fP is used, the new program will be exec\(cqed without forking. For further details, see \fBpid_namespaces\fP(7).
64 .RE
65 .sp
66 \fBuser namespace\fP
67 .RS 4
68 The process will have a distinct set of UIDs, GIDs and capabilities. For further details, see \fBuser_namespaces\fP(7).
69 .RE
70 .sp
71 \fBcgroup namespace\fP
72 .RS 4
73 The process will have a virtualized view of \fI/proc/self/cgroup\fP, and new cgroup mounts will be rooted at the namespace cgroup root. For further details, see \fBcgroup_namespaces\fP(7).
74 .RE
75 .sp
76 \fBtime namespace\fP
77 .RS 4
78 The process can have a distinct view of \fBCLOCK_MONOTONIC\fP and/or \fBCLOCK_BOOTTIME\fP which can be changed using \fI/proc/self/timens_offsets\fP. For further details, see \fBtime_namespaces\fP(7).
79 .RE
80 .SH "OPTIONS"
81 .sp
82 Various of the options below that relate to namespaces take an optional \fIfile\fP argument. This should be one of the \fI/proc/[pid]/ns/*\fP files described in \fBnamespaces\fP(7), or the pathname of a bind mount that was created on one of those files.
83 .sp
84 \fB\-a\fP, \fB\-\-all\fP
85 .RS 4
86 Enter all namespaces of the target process by the default \fI/proc/[pid]/ns/*\fP namespace paths. The default paths to the target process namespaces may be overwritten by namespace specific options (e.g., \fB\-\-all \-\-mount\fP=[\fIpath\fP]).
87 .sp
88 The user namespace will be ignored if the same as the caller\(cqs current user namespace. It prevents a caller that has dropped capabilities from regaining those capabilities via a call to setns(). See \fBsetns\fP(2) for more details.
89 .RE
90 .sp
91 \fB\-t\fP, \fB\-\-target\fP \fIPID\fP
92 .RS 4
93 Specify a target process to get contexts from. The paths to the contexts specified by \fIpid\fP are:
94 .sp
95 \fI/proc/pid/ns/mnt\fP
96 .RS 4
97 the mount namespace
98 .RE
99 .sp
100 \fI/proc/pid/ns/uts\fP
101 .RS 4
102 the UTS namespace
103 .RE
104 .sp
105 \fI/proc/pid/ns/ipc\fP
106 .RS 4
107 the IPC namespace
108 .RE
109 .sp
110 \fI/proc/pid/ns/net\fP
111 .RS 4
112 the network namespace
113 .RE
114 .sp
115 \fI/proc/pid/ns/pid\fP
116 .RS 4
117 the PID namespace
118 .RE
119 .sp
120 \fI/proc/pid/ns/user\fP
121 .RS 4
122 the user namespace
123 .RE
124 .sp
125 \fI/proc/pid/ns/cgroup\fP
126 .RS 4
127 the cgroup namespace
128 .RE
129 .sp
130 \fI/proc/pid/ns/time\fP
131 .RS 4
132 the time namespace
133 .RE
134 .sp
135 \fI/proc/pid/root\fP
136 .RS 4
137 the root directory
138 .RE
139 .sp
140 \fI/proc/pid/cwd\fP
141 .RS 4
142 the working directory respectively
143 .RE
144 .RE
145 .sp
146 \fB\-m\fP, \fB\-\-mount\fP[=\fIfile\fP]
147 .RS 4
148 Enter the mount namespace. If no file is specified, enter the mount namespace of the target process. If \fIfile\fP is specified, enter the mount namespace specified by \fIfile\fP.
149 .RE
150 .sp
151 \fB\-u\fP, \fB\-\-uts\fP[=\fIfile\fP]
152 .RS 4
153 Enter the UTS namespace. If no file is specified, enter the UTS namespace of the target process. If \fIfile\fP is specified, enter the UTS namespace specified by \fIfile\fP.
154 .RE
155 .sp
156 \fB\-i\fP, \fB\-\-ipc\fP[=\fIfile\fP]
157 .RS 4
158 Enter the IPC namespace. If no file is specified, enter the IPC namespace of the target process. If \fIfile\fP is specified, enter the IPC namespace specified by \fIfile\fP.
159 .RE
160 .sp
161 \fB\-n\fP, \fB\-\-net\fP[=\fIfile\fP]
162 .RS 4
163 Enter the network namespace. If no file is specified, enter the network namespace of the target process. If \fIfile\fP is specified, enter the network namespace specified by \fIfile\fP.
164 .RE
165 .sp
166 \fB\-p\fP, \fB\-\-pid\fP[=\fIfile\fP]
167 .RS 4
168 Enter the PID namespace. If no file is specified, enter the PID namespace of the target process. If \fIfile\fP is specified, enter the PID namespace specified by \fIfile\fP.
169 .RE
170 .sp
171 \fB\-U\fP, \fB\-\-user\fP[=\fIfile\fP]
172 .RS 4
173 Enter the user namespace. If no file is specified, enter the user namespace of the target process. If \fIfile\fP is specified, enter the user namespace specified by \fIfile\fP. See also the \fB\-\-setuid\fP and \fB\-\-setgid\fP options.
174 .RE
175 .sp
176 \fB\-C\fP, \fB\-\-cgroup\fP[=\fIfile\fP]
177 .RS 4
178 Enter the cgroup namespace. If no file is specified, enter the cgroup namespace of the target process. If \fIfile\fP is specified, enter the cgroup namespace specified by \fIfile\fP.
179 .RE
180 .sp
181 \fB\-T\fP, \fB\-\-time\fP[=\fIfile\fP]
182 .RS 4
183 Enter the time namespace. If no file is specified, enter the time namespace of the target process. If \fIfile\fP is specified, enter the time namespace specified by \fIfile\fP.
184 .RE
185 .sp
186 \fB\-G\fP, \fB\-\-setgid\fP \fIgid\fP
187 .RS 4
188 Set the group ID which will be used in the entered namespace and drop supplementary groups. \fBnsenter\fP always sets GID for user namespaces, the default is 0.
189 .RE
190 .sp
191 \fB\-S\fP, \fB\-\-setuid\fP \fIuid\fP
192 .RS 4
193 Set the user ID which will be used in the entered namespace. \fBnsenter\fP always sets UID for user namespaces, the default is 0.
194 .RE
195 .sp
196 \fB\-\-preserve\-credentials\fP
197 .RS 4
198 Don\(cqt modify UID and GID when enter user namespace. The default is to drops supplementary groups and sets GID and UID to 0.
199 .RE
200 .sp
201 \fB\-r\fP, \fB\-\-root\fP[=\fIdirectory\fP]
202 .RS 4
203 Set the root directory. If no directory is specified, set the root directory to the root directory of the target process. If directory is specified, set the root directory to the specified directory. The specified \fIdirectory\fP is open before it switches to the requested namespaces.
204 .RE
205 .sp
206 \fB\-w\fP, \fB\-\-wd\fP[=\fIdirectory\fP]
207 .RS 4
208 Set the working directory. If no directory is specified, set the working directory to the working directory of the target process. If directory is specified, set the working directory to the specified directory. The specified \fIdirectory\fP is open before it switches to the requested namespaces, it means the specified directory works as "tunnel" to the current namespace. See also \fB\-\-wdns\fP.
209 .RE
210 .sp
211 \fB\-W\fP, \fB\-\-wdns\fP[=\fIdirectory\fP]
212 .RS 4
213 Set the working directory. The \fIdirectory\fP is open after switch to the requested namespaces and after \fBchroot\fP(2) call. The options \fB\-\-wd\fP and \fB\-\-wdns\fP are mutually exclusive.
214 .RE
215 .sp
216 \fB\-F\fP, \fB\-\-no\-fork\fP
217 .RS 4
218 Do not fork before exec\(cqing the specified program. By default, when entering a PID namespace, \fBnsenter\fP calls \fBfork\fP before calling \fBexec\fP so that any children will also be in the newly entered PID namespace.
219 .RE
220 .sp
221 \fB\-Z\fP, \fB\-\-follow\-context\fP
222 .RS 4
223 Set the SELinux security context used for executing a new process according to already running process specified by \fB\-\-target\fP PID. (The util\-linux has to be compiled with SELinux support otherwise the option is unavailable.)
224 .RE
225 .sp
226 \fB\-h\fP, \fB\-\-help\fP
227 .RS 4
228 Display help text and exit.
229 .RE
230 .sp
231 \fB\-V\fP, \fB\-\-version\fP
232 .RS 4
233 Print version and exit.
234 .RE
235 .SH "AUTHORS"
236 .sp
237 .MTO "biederm\(atxmission.com" "Eric Biederman" ","
238 .MTO "kzak\(atredhat.com" "Karel Zak" ""
239 .SH "SEE ALSO"
240 .sp
241 \fBclone\fP(2),
242 \fBsetns\fP(2),
243 \fBnamespaces\fP(7)
244 .SH "REPORTING BUGS"
245 .sp
246 For bug reports, use the issue tracker at \c
247 .URL "https://github.com/util\-linux/util\-linux/issues" "" "."
248 .SH "AVAILABILITY"
249 .sp
250 The \fBnsenter\fP command is part of the util\-linux package which can be downloaded from \c
251 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."