Ubuntu Manpages

unshare

run program with some namespaces unshared from parent

unshare [options] program [arguments]

Unshares specified namespaces from parent process and then executes specified program. Unshareable namespaces are:

mounting and unmounting filesystems will not affect rest of the system (CLONE_NEWNS flag),
setting hostname, domainname will not affect rest of the system (CLONE_NEWUTS flag),
process will have independent namespace for System V message queues, semaphore sets and shared memory segments (CLONE_NEWIPC flag),
process will have independent IPv4 and IPv6 stacks, IP routing tables, firewall rules, the /proc/net and /sys/class/net directory trees, sockets etc. (CLONE_NEWNET flag).

Print a help message,
Unshare the mount namespace,
Unshare the UTS namespace,
Unshare the IPC namespace,
Unshare the network namespace.

The unshare command drops potential privileges before executing the target program. This allows to setuid unshare.

unshare(2), clone(2)

None known so far.

Mikhail Gusarov <dottedmag@dottedmag.net>

The unshare command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.