<?xml version="1.0" encoding="UTF-8"?>
<!-- **************************************************************************
.... For copyright and licensing terms, see the file named COPYING.
.... **************************************************************************
.-->
<?xml-stylesheet href="docbook-xml.css" type="text/css"?>

<refentry id="unshare">

<refmeta xmlns:xi="http://www.w3.org/2001/XInclude">
<refentrytitle>unshare</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">user commands</refmiscinfo>
<refmiscinfo class="source">nosh</refmiscinfo>
<xi:include href="version.xml" />
</refmeta>

<refnamediv>
<refname>unshare</refname>
<refpurpose>un-share various namespaces making them private to the process</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>unshare</command>
<arg choice='opt'>--mount</arg>
<arg choice='opt'>--network</arg>
<arg choice='opt'>--uts</arg>
<arg choice='opt'>--ipc</arg>
<arg choice='opt'>--process</arg>
<arg choice='opt'>--user</arg>
<arg choice='req'><replaceable>next-prog</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection><title>BSD Note</title>

<para>
This command currently has no effect on BSD.
Be careful, therefore, of the effect that this will have on <citerefentry><refentrytitle>make-private-fs</refentrytitle><manvolnum>1</manvolnum></citerefentry> and <citerefentry><refentrytitle>make-read-only-fs</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>

</refsection>
<refsection><title>Description</title>

<para>
<command>unshare</command> is a chain-loading utility that calls <citerefentry><refentrytitle>unshare</refentrytitle><manvolnum>2</manvolnum></citerefentry> to "unshare" various "namespaces" from its parent process and then chain loads to <replaceable>next-prog</replaceable> with the <citerefentry><refentrytitle>execvp</refentrytitle><manvolnum>3</manvolnum></citerefentry> function.
</para>

<para>
<replaceable>next-prog</replaceable> may contain its own command line options, which <command>unshare</command> will ignore.
</para>

<para>
The namespaces un-shared are controlled by command-line options as follows:
</para>

<variablelist>

<varlistentry>
<term><arg>--mount</arg></term>
<listitem><para>The process switches to a private namespace of mounted filesystems.</para></listitem>
</varlistentry>

<varlistentry>
<term><arg>--network</arg></term>
<listitem><para>The process switches to a private namespace of network interfaces.</para></listitem>
</varlistentry>

<varlistentry>
<term><arg>--uts</arg></term>
<listitem><para>The process switches to a private namespace of UTS names.</para></listitem>
</varlistentry>

<varlistentry>
<term><arg>--IPC</arg></term>
<listitem><para>The process switches to a private namespace of IPC names.</para></listitem>
</varlistentry>

<varlistentry>
<term><arg>--process</arg></term>
<listitem><para>The process switches to a private namespace of process IDs.</para></listitem>
</varlistentry>

<varlistentry>
<term><arg>--user</arg></term>
<listitem><para>The process switches to a private namespace of user IDs.</para></listitem>
</varlistentry>

</variablelist>

</refsection><refsection><title>Security</title>

<para>
The command will fail if the process is not running under the aegis of the superuser and the <citerefentry><refentrytitle>unshare</refentrytitle><manvolnum>2</manvolnum></citerefentry> function call thus fails.
Non-superusers are not permitted to unshare these things.
</para>

</refsection><refsection><title>Author</title>
<para><author><personname><firstname>Jonathan</firstname> <surname>de Boyne Pollard</surname></personname></author></para>
</refsection>

</refentry>
