]>
Commit | Line | Data |
---|---|---|
4205f1fd MG |
1 | .\" Process this file with |
2 | .\" groff -man -Tascii lscpu.1 | |
3 | .\" | |
dde08a87 | 4 | .TH UNSHARE 1 "May 2013" "util-linux" "User Commands" |
4205f1fd | 5 | .SH NAME |
ef6acdb8 | 6 | unshare \- run program with some namespaces unshared from parent |
4205f1fd MG |
7 | .SH SYNOPSIS |
8 | .B unshare | |
dde08a87 BS |
9 | .RB [ options ] |
10 | .I program | |
4205f1fd MG |
11 | .RI [ arguments ] |
12 | .SH DESCRIPTION | |
dde08a87 BS |
13 | Unshares the indicated namespaces from the parent process and then executes |
14 | the specified program. Unshareable namespaces are: | |
4205f1fd MG |
15 | .TP |
16 | .BR "mount namespace" | |
dde08a87 | 17 | Mounting and unmounting filesystems will not affect the rest of the system |
bc87f885 | 18 | (\fBCLONE_NEWNS\fP flag), except for filesystems which are explicitly marked as |
dde08a87 BS |
19 | shared (with \fBmount --make-shared\fP; see \fI/proc/self/mountinfo\fP for the |
20 | \fBshared\fP flags). | |
4205f1fd MG |
21 | .TP |
22 | .BR "UTS namespace" | |
dde08a87 BS |
23 | Setting hostname or domainname will not affect the rest of the system. |
24 | (\fBCLONE_NEWUTS\fP flag) | |
4205f1fd MG |
25 | .TP |
26 | .BR "IPC namespace" | |
dde08a87 BS |
27 | The process will have an independent namespace for System V message queues, |
28 | semaphore sets and shared memory segments. (\fBCLONE_NEWIPC\fP flag) | |
4205f1fd MG |
29 | .TP |
30 | .BR "network namespace" | |
dde08a87 BS |
31 | The process will have independent IPv4 and IPv6 stacks, IP routing tables, |
32 | firewall rules, the \fI/proc/net\fP and \fI/sys/class/net\fP directory trees, | |
33 | sockets, etc. (\fBCLONE_NEWNET\fP flag) | |
4205f1fd | 34 | .TP |
bc7f9b95 | 35 | .BR "pid namespace" |
dde08a87 BS |
36 | Children will have a distinct set of PID to process mappings from their parent. |
37 | (\fBCLONE_NEWPID\fP flag) | |
bc7f9b95 EB |
38 | .TP |
39 | .BR "user namespace" | |
dde08a87 BS |
40 | The process will have a distinct set of UIDs, GIDs and capabilities. |
41 | (\fBCLONE_NEWUSER\fP flag) | |
e41e0f95 | 42 | .PP |
dde08a87 | 43 | See \fBclone\fR(2) for the exact semantics of the flags. |
4205f1fd MG |
44 | .SH OPTIONS |
45 | .TP | |
46 | .BR \-h , " \-\-help" | |
b4362b6f | 47 | Display help text and exit. |
4205f1fd | 48 | .TP |
ef6acdb8 | 49 | .BR \-i , " \-\-ipc" |
dde08a87 BS |
50 | Unshare the IPC namespace. |
51 | .TP | |
52 | .BR \-m , " \-\-mount" | |
53 | Unshare the mount namespace. | |
4205f1fd | 54 | .TP |
ef6acdb8 KZ |
55 | .BR \-n , " \-\-net" |
56 | Unshare the network namespace. | |
bc7f9b95 EB |
57 | .TP |
58 | .BR \-p , " \-\-pid" | |
6728ca10 | 59 | Unshare the pid namespace. See also \fB--fork\fP and \fB--mount-proc\fP options. |
bc7f9b95 | 60 | .TP |
dde08a87 BS |
61 | .BR \-u , " \-\-uts" |
62 | Unshare the UTS namespace. | |
63 | .TP | |
bc7f9b95 EB |
64 | .BR \-U , " \-\-user" |
65 | Unshare the user namespace. | |
5088ec33 MF |
66 | .TP |
67 | .BR \-f , " \-\-fork" | |
68 | Fork the specified process as a child of unshare rather than running it | |
69 | directly. This is useful when creating a new pid namespace. | |
6728ca10 KZ |
70 | .TP |
71 | .BR "\fB\-\-mount-proc\fR [=\fImountpoint\fP]" | |
72 | Just before running the program, mount the proc filesystem at the \fImountpoint\fP | |
73 | (default is /proc). This is useful when creating a new pid namespace. It also | |
74 | implies creating a new mount namespace since the /proc mount would otherwise | |
75 | mess up existing programs on the system. | |
4205f1fd | 76 | .SH SEE ALSO |
8323d9fd MF |
77 | .BR unshare (2), |
78 | .BR clone (2) | |
4205f1fd MG |
79 | .SH BUGS |
80 | None known so far. | |
ef6acdb8 | 81 | .SH AUTHOR |
4205f1fd MG |
82 | Mikhail Gusarov <dottedmag@dottedmag.net> |
83 | .SH AVAILABILITY | |
601d12fb KZ |
84 | The unshare command is part of the util-linux package and is available from |
85 | ftp://ftp.kernel.org/pub/linux/utils/util-linux/. |