<?Pub UDT _bookmark _target?><?Pub EntList bsol dash hellip gt lt minus?><?Pub CX solbook(book(title()bookinfo()part()part(title()partintro()chapter()?><chapter id="managefiles-1"><?Pub Tag atict:info tracking="on" ref="0"?><?Pub Tag
atict:user user="sharonr" fullname="Sharon Veach"?><title>Managing and Mounting
Files in Trusted Extensions (Tasks)</title><highlights><para>This chapter describes how LOFS mounts and NFS mounts work on a system
that is configured with Trusted Extensions. This chapter also covers how to back
up and restore files.</para><itemizedlist remap="jumplist"><listitem><para><olink targetptr="managefiles-16" remap="internal">Sharing and Mounting Files
in Trusted Extensions</olink></para>
</listitem><listitem><para><olink targetptr="txnet-10" remap="internal">NFS Mounts in Trusted Extensions</olink></para>
</listitem><listitem><para><olink targetptr="managefiles-18" remap="internal">Sharing Files From a Labeled
Zone</olink></para>
</listitem><listitem><para><olink targetptr="managefiles-31" remap="internal">Access to NFS Mounted Directories
in Trusted Extensions</olink></para>
</listitem><listitem><para><olink targetptr="managefiles-26" remap="internal">Trusted Extensions Software
and NFS Protocol Versions</olink></para>
</listitem><listitem><para><olink targetptr="managefiles-6" remap="internal">Backing Up, Sharing, and
Mounting Labeled Files (Task Map)</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="managefiles-16"><title>Sharing and Mounting Files in Trusted Extensions</title><indexterm><primary>file systems</primary><secondary>sharing</secondary>
</indexterm><indexterm><primary>administering</primary><secondary>file systems</secondary><tertiary>overview</tertiary>
</indexterm><para>Trusted Extensions software supports the same file systems and file system
management commands as the Solaris OS. Trusted Extensions adds the ability for a
non-global zone to share files. In addition, Trusted Extensions attaches a unique
label to every non-global zone. All the files and directories that belong
to that zone are mounted at the label of the zone. Any shared file systems
that belong to other zones or to NFS servers are mounted at the label of the
owner. Trusted Extensions prevents any mounts that would violate the mandatory
access control (MAC) policies for labeling. For example, a zone's label must
dominate all of its mounted file system labels, and only equally labeled file
systems can be mounted with read/write permissions.</para>
</sect1><sect1 id="txnet-10"><title>NFS Mounts in Trusted Extensions</title><indexterm><primary>mounting</primary><secondary>overview</secondary>
</indexterm><indexterm><primary>file systems</primary><secondary>NFS mounts</secondary>
</indexterm><indexterm><primary>NFS mounts</primary><secondary>in global and labeled zones</secondary>
</indexterm><indexterm><primary>file systems</primary><secondary>sharing in global and labeled zones</secondary>
</indexterm><indexterm><primary>file systems</primary><secondary>mounting in global and labeled zones</secondary>
</indexterm><para>NFS mounts in Trusted Extensions are similar to Solaris mounts. The
differences occur in the use of zone root pathnames when mounting a labeled
zone in Trusted Extensions, and in the enforcement of MAC policy.</para><itemizedlist><para>NFS shares in Trusted Extensions are similar to Solaris shares in
a global zone. However, the sharing of files from a labeled zone on a multilevel
system is unique to Trusted Extensions:</para><listitem><para><emphasis role="strong">Shares and mounts in the global zone &ndash;</emphasis> Sharing and mounting files in the global zone of a Trusted Extensions system
is almost identical to the procedure in the Solaris OS. For mounting files, the
automounter, the <filename>vfstab</filename> file, and the <command>mount</command> command
can be used. For sharing files, the <filename>dfstab</filename> file is used.</para>
</listitem><listitem><para><emphasis role="strong">Mounts in labeled zones &ndash;</emphasis> Mounting
files in labeled zones in Trusted Extensions is almost identical to mounting files
in non-global zones in the Solaris OS. For mounting files, the automounter, the <filename>vfstab</filename> file, and the <command>mount</command> command can be used.
In Trusted Extensions, a unique <filename>automount_home_<replaceable>label</replaceable></filename> configuration
file exists for each labeled zone.</para>
</listitem><listitem><para><emphasis role="strong">Shares in labeled zones &ndash;</emphasis> Files
in a labeled zone can be shared at the label of the zone by using a <filename>dfstab</filename> file that is at the label of the zone, but is visible to the global
zone only. So, configuring a labeled zone to share files is performed by the
global zone administrator in the global zone. This configuration file is not
visible from its labeled zone. For more discussion, see <olink targetptr="managezones-12" remap="internal">Global Zone Processes and Labeled Zones</olink>.</para>
</listitem>
</itemizedlist><para>Labels affect which files can be mounted. Files are shared and mounted
at a particular label. For a Trusted Extensions client to write to a file that
is NFS-mounted, the file must be mounted with read/write permissions <emphasis>and</emphasis> be at the same label as the client. If you are mounting a file
between two Trusted Extensions hosts, the server and the client must have compatible
remote host templates of type <literal>cipso</literal>. If you are mounting
a file between a Trusted Extensions host and an unlabeled host, files that are
at the single label that is specified for the unlabeled host in the <filename>tnrhdb</filename> file can be mounted. Files that are mounted with LOFS can be viewed,
but cannot be modified. For details on NFS mounts, see <olink targetptr="managefiles-31" remap="internal">Access to NFS Mounted Directories in Trusted Extensions</olink>.</para><para>Labels also affect which directories and files can be viewed. By default,
lower-level objects are available in a user's environment. Therefore, in the
default configuration, a regular user can view files that are in a zone at
a lower level than the user's current level. For example, users can see their
lower-level home directories from a higher label. For details, see <olink targetptr="txnet-12" remap="internal">Home Directory Creation in Trusted Extensions</olink>.</para><para>If site security forbids the viewing of lower-level objects, you can
make lower-level directories invisible to the user.  For details, see <olink targetptr="managezones-3" remap="internal">How to Disable the Mounting of Lower-Level Files</olink>.</para><para>The mount policy in Trusted Extensions has no MAC overrides. Mounted files
that are visible at a lower label can never be modified by a higher-label
process. This MAC policy is also in effect in the global zone. A global zone <constant>ADMIN_HIGH</constant> process cannot modify an NFS-mounted file at a lower
label, such as a <constant>PUBLIC</constant> file or an <constant>ADMIN_LOW</constant> file.
MAC policies enforce the default configuration and are invisible to regular
users. Regular users cannot see objects unless they have MAC access to them.</para>
</sect1><sect1 id="managefiles-18"><title>Sharing Files From a Labeled Zone</title><para>In the Solaris OS, a non-global zone cannot share directories from its
zone. However, in Trusted Extensions, a labeled zone can share directories. The
specification of which directories in a labeled zone can be shared is performed
in the global zone by using a directory that is outside the <filename class="directory">root</filename> path of the zone. For more discussion, see <olink targetptr="managezones-12" remap="internal">Global Zone Processes and Labeled Zones</olink>.</para><variablelist><varlistentry><term><filename class="directory">/zone/<replaceable>labeled-zone</replaceable>/<replaceable>directories</replaceable></filename></term><listitem><para>Also called the zone path. Is the path from the global zone
to the labeled zone. Every directory under <replaceable>labeled-zone</replaceable> is
labeled the same as the zone. Global zone processes that are started under
this directory start at the label of the zone.</para>
</listitem>
</varlistentry><varlistentry><term><filename class="directory">/zone/<replaceable>labeled-zone</replaceable>/root/<replaceable>directories</replaceable></filename></term><listitem><para>Also called the zone root path. Is the <filename class="directory">root</filename> path of a labeled zone from the perspective
of the global zone. From the perspective of the labeled zone, this is the
zone's root, the <filename class="directory">/</filename> directory. This
path is not used by the global zone to administer the zone.</para>
</listitem>
</varlistentry>
</variablelist><para>To share directories from a labeled zone, the global zone administrator
creates and modifies the <filename>dfstab</filename> file in the <filename class="directory">/etc</filename> directory of the zone path:</para><screen>/zone/<replaceable>labeled-zone</replaceable>/etc/dfs/dfstab</screen><para>This <filename class="directory">/etc</filename> directory is not visible
from the labeled zone. This directory is distinct from the <filename class="directory">/etc</filename> directory that is visible from the zone:</para><screen>Global zone view: /zone/<replaceable>labeled-zone</replaceable>/root/etc
Labeled zone view of the same directory: /etc</screen><para>A <filename>dfstab</filename> file in this path does not enable labeled
directories to be shared.</para><para>When the status of the labeled zone is <literal>ready</literal> or <literal>running</literal>, the files that are listed in the <filename>/zone/<replaceable>labeled-zone</replaceable>/etc/dfs/dfstab</filename> file are shared at the
label of the zone. For the procedure, see <olink targetptr="txconf-43" remap="internal">How
to Share Directories From a Labeled Zone</olink>.</para>
</sect1><sect1 id="managefiles-31"><title>Access to NFS Mounted Directories in Trusted Extensions</title><indexterm><primary>NFS mounts</primary><secondary>accessing lower-level directories</secondary>
</indexterm><para>By default, NFS-mounted file systems are visible at the label of the
exported file system. If the file system is exported with read/write permissions,
users at that label can write to the files. NFS mounts that are at a lower
label than the user's current session are visible to the user, but cannot
be written to. Even if a file system is shared with read/write permissions,
the mounting system can write to it only at the label of the mount.</para><para>To make lower-level directories that are NFS-mounted visible to users
in a higher-level zone, the administrator of the global zone on the NFS server
must export the parent directory. The parent directory is exported at its
label. On the client side, each zone must have the <constant>net_mac_aware</constant> privilege.
By default, labeled zones include the <constant>net_mac_aware</constant> privilege
in their <literal>limitpriv</literal> set.</para><itemizedlist><listitem><para><emphasis role="strong">Server configuration &ndash;</emphasis> On
the NFS server, you export the parent directory in a <filename>dfstab</filename> file.
If the parent directory is in a labeled zone, the <filename>dfstab</filename> file
must be modified in the labeled zone of the parent directory. The <filename>dfstab</filename> file for a labeled zone is visible only from the global zone.
For the procedure, see <olink targetptr="txconf-43" remap="internal">How to Share Directories
From a Labeled Zone</olink>.</para>
</listitem><listitem><para><emphasis role="strong">Client configuration &ndash;</emphasis> The <constant>net_mac_aware</constant> privilege must be specified in the zone configuration
file that is used during initial zone configuration. So, a user who is permitted
to view all lower-level home directories must have the <constant>net_mac_aware</constant> privilege
in every zone, except the lowest zone. For an example, see <olink targetptr="txconf-41" remap="internal">How to NFS Mount Files in a Labeled Zone</olink>.</para>
</listitem>
</itemizedlist><example id="managefiles-22"><title>Providing Access to Lower-Level Home Directories</title><indexterm><primary><filename>/zone/public/etc/dfs/dfstab</filename> file</primary>
</indexterm><indexterm><primary><filename>dfstab</filename> file</primary><secondary>for <filename>public</filename> zone</secondary>
</indexterm><indexterm><primary><filename>/etc/dfs/dfstab</filename> file for <filename>public</filename> zone</primary>
</indexterm><para>On the home directory server, the administrator creates and modifies
the <filename>/zone/<replaceable>labeled-zone</replaceable>/etc/dfs/dfstab</filename> file
in every labeled zone. The <filename>dfstab</filename> file exports the <filename>/export/home</filename> directory with read/write permissions. Thus, when
the directory is mounted at the same label, the home directory is writable.
To export the <filename class="directory">/export/home</filename> directory
of <literal>PUBLIC</literal>, the administrator creates a workspace at the <literal>PUBLIC</literal> label on the home directory server, and from the global zone,
modifies the <filename>/zone/public/etc/dfs/dfstab</filename> file.</para><para>On the client, the administrator of the global zone checks that every
labeled zone, except the lowest label, has the <constant>net_mac_aware</constant> privilege.
This privilege permits the mount. This privilege can be specified by using
the <command>zonecfg</command> command during zone configuration. The lower-level
home directory can only be viewed. MAC protects the files in the directory
from modification.</para>
</example><sect2 id="txnet-12"><title>Home Directory Creation in Trusted Extensions</title><indexterm><primary>creating</primary><secondary>home directories</secondary>
</indexterm><indexterm><primary>home directories</primary><secondary>creating</secondary>
</indexterm><para>Home directories are a special case in Trusted Extensions. You need to make
sure that the home directories are created in every zone that a user can use.
Also, the home directory mount points must be created in the zones on the
user's system. For NFS-mounted home directories to work correctly, the conventional
location for directories, <filename class="directory">/export/home</filename>,
must be used. In Trusted Extensions, the automounter has been modified to handle
home directories in every zone, that is, at every label. For details, see <olink targetptr="managefiles-19" remap="internal">Changes to the Automounter in Trusted Extensions</olink>.</para><para>Home directories are created when users are created. In Trusted Extensions,
the Solaris Management Console (Console) is used to create users, so the Console creates the home
directories. However, the Console creates the home directories in the global
zone of the home directory server. On that server, the directories are mounted
by LOFS. Home directories are automatically created by the automounter if
they are specified as LOFS mounts.</para><para>However, the automounter cannot automatically create home directories
on remote NFS servers. Either the user must first log in to the NFS server
or administrative intervention is required. To create home directories for
users, see <olink targetptr="txconf-56" remap="internal">Enable Users
to Access Their Home Directories in Trusted Extensions</olink>.</para>
</sect2><sect2 id="managefiles-19"><title>Changes to the Automounter in Trusted Extensions</title><para>In Trusted Extensions, each label requires a separate home directory mount.
The <command>automount</command> command has been modified to handle these
labeled automounts. For each zone, the automounter, <command>autofs</command>,
mounts an <literal>auto_home_</literal><replaceable>zone-name</replaceable> file.
For example, the following is the entry for the global zone in the <filename>auto_home_global</filename> file:</para><screen>+auto_home_global
*       -fstype=lofs    :/export/home/&amp;</screen><para>When a zone that permits lower-level zones to be mounted is booted,
the following occurs. The home directories of lower-level zones are mounted
read only under <filename>/zone/&lt;</filename><replaceable>zone-name</replaceable><filename>&gt;/export/home</filename>. The <filename>auto_home_&lt;</filename><replaceable>zone-name</replaceable><filename>&gt;</filename> map specifies the <filename>/zone</filename> path
as the source directory for an <filename>lofs</filename> remount onto <filename>/zone/&lt;</filename><replaceable>zone-name</replaceable><filename>&gt;/home/&lt;</filename><replaceable>username</replaceable><filename>&gt;</filename>.</para><para>For example, the following is an <filename>auto_home_public</filename> entry
in an <filename>auto_home_</filename><replaceable>zone-at-higher-label</replaceable> map
that is generated from a higher-level zone:</para><screen>+auto_home_public
*       -fstype=lofs    :/zone/public/export/home/&amp;</screen><para>The following is the corresponding entry in the public zone:</para><screen>auto_home_public
*       -fstype=lofs    :/export/home/&amp;</screen><orderedlist><para>When a home directory is referenced and the name does not match any
entries in the <filename>auto_home_&lt;</filename><replaceable>zone-name</replaceable><filename>&gt;</filename> map, the map tries to match this loopback mount specification.
The software creates the home directory when the following two conditions
are met:</para><listitem><para>The map finds the match of the loopback mount specification</para>
</listitem><listitem><para>The home directory name matches a valid user whose home directory
does not yet exist in <replaceable>zone-name</replaceable></para>
</listitem>
</orderedlist><para>For details on changes to the automounter, see the <olink targetdoc="group-refman" targetptr="automount-1m" remap="external"><citerefentry><refentrytitle>automount</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2>
</sect1><sect1 id="managefiles-26"><title>Trusted Extensions Software and NFS Protocol
Versions</title><indexterm><primary>multilevel mounts</primary><secondary>NFS protocol versions</secondary>
</indexterm><para>In
the Solaris Express Community Edition, Trusted Extensions software recognizes labels on NFS Version 3 (NFSv3)
and NFSv4. You can use one of the following sets of mount options:</para><screen>vers=4 proto=tcp
vers=3 proto=tcp
vers=3 proto=udp</screen><para>Trusted Extensions has no restrictions on mounts over the <literal>tcp</literal> protocol.
In NFSv3 and NFSv4, the <literal>tcp</literal> protocol can be used for same-label
mounts and for read-down mounts. Read-down mounts require a multilevel port
(MLP).</para><para>For NFSv3, Trusted Extensions behaves like the Solaris OS. The <literal>udp</literal> protocol
is the default for NFSv3, but <literal>udp</literal> is used only for the
initial mount operation. For subsequent NFS operations, the system uses <literal>tcp</literal>. Therefore, read-down mounts work for NFSv3 in the default configuration.</para><para>In the rare case that you have restricted NFSv3 mounts to use the udp
protocol for initial and subsequent NFS operations, you must create an MLP
 for NFS operations that use the <literal>udp</literal> protocol. For the
procedure, see <olink targetptr="managezones-28" remap="internal">How to Configure a Multilevel
Port for NFSv3 Over udp</olink>.</para><para>A host that is configured with Trusted Extensions can also share its own
file systems with unlabeled hosts. A file or directory that is exported to
an unlabeled host is <emphasis>writable</emphasis> if its label equals the
label that is associated with the remote host in its trusted networking database
entries. A file or directory that is exported to an unlabeled host is <emphasis>readable</emphasis> only if its label is dominated by the label that is associated
with the remote host.</para><para>Communications with systems that are running a release of Trusted Solaris software
is possible only at a single label. The Trusted Extensions system and the Trusted Solaris system
must assign to the other system a template with the unlabeled host type. The
unlabeled host types must specify the same single label. As an unlabeled NFS
client of a Trusted Solaris server, the label of the client cannot be <constant>ADMIN_LOW</constant>.</para><para>The NFS protocol that is used is independent of the local file system's
type. Rather, the protocol depends on the type of the sharing computer's operating
system. The file system type that is specified to the <filename>mount</filename> command
or in the <filename>vfstab</filename> file for remote file systems is always
NFS.</para>
</sect1><sect1 id="managefiles-6"><title>Backing Up, Sharing, and Mounting Labeled
Files (Task Map)</title><indexterm><primary>Backing Up, Sharing, and Mounting Labeled Files (Task Map)</primary>
</indexterm><indexterm><primary>tasks and task maps</primary><secondary>Backing Up, Sharing, and Mounting Labeled Files (Task Map)</secondary>
</indexterm><para>The following task map describes common tasks that are used to back
up and restore data from labeled file systems, and to share and mount directories
and files that are labeled.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colwidth="33*"/><colspec colwidth="33*"/><colspec colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Back up files.</para>
</entry><entry><para>Protects your data by backing it up.</para>
</entry><entry><para><olink targetptr="managefiles-13" remap="internal">How to Back Up Files in Trusted Extensions</olink></para>
</entry>
</row><row><entry><para>Restore data.</para>
</entry><entry><para>Restores data from a backup.</para>
</entry><entry><para><olink targetptr="managefiles-14" remap="internal">How to Restore Files in Trusted Extensions</olink></para>
</entry>
</row><row><entry><para>Share the contents of a directory from a labeled zone.</para>
</entry><entry><para>Allows the contents of a labeled directory to be shared among users.</para>
</entry><entry><para><olink targetptr="txconf-43" remap="internal">How to Share Directories From a Labeled
Zone</olink></para>
</entry>
</row><row><entry><para>Mount the contents of a directory that was shared by a labeled zone.</para>
</entry><entry><para>Allows the contents of a directory to be mounted in a zone at the same
label for read/write. When a higher-level zone mounts the shared directory,
the directory is mounted read-only.</para>
</entry><entry><para><olink targetptr="txconf-41" remap="internal">How to NFS Mount Files in a Labeled Zone</olink></para>
</entry>
</row><row><entry><para>Create home directory mount points.</para>
</entry><entry><para>Creates mount points for every user at every label. This task enables
users to access their home directory on a system that is not the NFS home
directory server.</para>
</entry><entry><para><olink targetptr="txconf-56" remap="internal">Enable Users
to Access Their Home Directories in Trusted Extensions</olink></para>
</entry>
</row><row><entry><para>Hide lower-level information from a user who is working at a higher
label.</para>
</entry><entry><para>Prevent the viewing of lower-level information from a higher-level window.</para>
</entry><entry><para><olink targetptr="managezones-3" remap="internal">How to Disable the Mounting of Lower-Level
Files</olink></para>
</entry>
</row><row><entry><para>Troubleshoot file system mounting problems.</para>
</entry><entry><para>Resolve problems with mounting a file system.</para>
</entry><entry><para><olink targetptr="managefiles-20" remap="internal">How to Troubleshoot Mount Failures
in Trusted Extensions</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><task id="managefiles-13"><title>How to Back Up Files in Trusted Extensions</title><indexterm><primary>files</primary><secondary>backing up</secondary>
</indexterm><indexterm><primary>administering</primary><secondary>files</secondary><tertiary>backing up </tertiary>
</indexterm><procedure><step><para>Assume the Operator role.</para><para>This role includes the Media
Backup rights profile.</para>
</step><step><para>Use one of the following backup methods:</para><itemizedlist><listitem><para><command>/usr/lib/fs/ufs/ufsdump</command> for major backups</para>
</listitem><listitem><para><command>/usr/sbin/tar cT</command> for small backups</para>
</listitem><listitem><para>A script calling either of these commands</para><para>For
example, the <application>Budtool</application> backup application calls the <filename>ufsdump</filename> command. See the <olink targetdoc="group-refman" targetptr="ufsdump-1m" remap="external"><citerefentry><refentrytitle>ufsdump</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page. For details on
the <option role="nodash">T</option> option to the <command>tar</command> command,
see the <olink targetdoc="group-refman" targetptr="tar-1" remap="external"><citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para>
</listitem>
</itemizedlist>
</step>
</procedure>
</task><task id="managefiles-14"><title>How to Restore Files in Trusted Extensions</title><indexterm><primary>files</primary><secondary>restoring</secondary>
</indexterm><indexterm><primary>administering</primary><secondary>files</secondary><tertiary>restoring </tertiary>
</indexterm><procedure><step><para>Assume the System Administrator role.</para><para>This role includes
the Media Restore rights profile.</para>
</step><step><para>Use one of the following methods:</para><itemizedlist><listitem><para><command>/usr/lib/fs/ufs/ufsrestore</command> for major restores</para>
</listitem><listitem><para><command>/usr/sbin/tar xT</command> for small restores</para>
</listitem><listitem><para>A script calling either of these commands</para>
</listitem>
</itemizedlist><para>For details on the <option role="nodash">T</option> option to the <command>tar</command> command, see the <olink targetdoc="group-refman" targetptr="tar-1" remap="external"><citerefentry><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man
page.</para><caution><para>Only these commands preserve labels.</para>
</caution>
</step>
</procedure>
</task><task id="txconf-43"><title>How to Share Directories From a Labeled Zone</title><indexterm><primary>administering</primary><secondary>sharing file systems</secondary>
</indexterm><indexterm><primary>files and file systems</primary><secondary>mounting</secondary>
</indexterm><indexterm><primary>mounting</primary><secondary>file systems</secondary>
</indexterm><indexterm><primary>directories</primary><secondary>mounting</secondary>
</indexterm><indexterm><primary>directories</primary><secondary>sharing</secondary>
</indexterm><indexterm><primary>files and file systems</primary><secondary>sharing</secondary>
</indexterm><tasksummary><para>As in the Solaris OS, the Mounts and Shares tool in the Solaris Management Console is used to
share and mount files from the global zone. The tool cannot be used to mount
or share directories that originate in labeled zones. Create a <filename>dfstab</filename> file
at the label of the zone, and then restart the zone to share the labeled directories.</para><caution><para><indexterm><primary>protecting</primary><secondary>file systems by using non-proprietary names</secondary></indexterm><indexterm><primary>files and file systems</primary><secondary>naming</secondary></indexterm><indexterm><primary>names of file systems</primary></indexterm>Do not use proprietary
names for shared file systems. The names of shared file systems are visible
to every user.</para>
</caution>
</tasksummary><taskprerequisites><para>You must be superuser, or in the System Administrator role in the global
zone on the file server.</para>
</taskprerequisites><procedure><step><para>Create a workspace at the label of the directory that is going
to be shared.</para><para>For details, see <olink targetdoc="trssug" targetptr="shared-commontasks-37" remap="external"><citetitle remap="section">How to Add a Workspace at a Particular Label</citetitle> in <citetitle remap="book">Solaris Trusted Extensions User&rsquo;s Guide</citetitle></olink>.</para>
</step><step><para>Create a <filename>dfstab</filename> file in at the label of that
zone.</para><para>For each zone that will share a directory, repeat the following
steps:</para><substeps><step><para>Create the <filename>/etc/dfs</filename> directory in the zone.</para><screen># mkdir -p <filename class="directory">/zone/<replaceable>zone-name</replaceable>/etc/dfs</filename></screen>
</step><step><para>Open the trusted editor.</para><para>For details, see <olink targetptr="roles-10" remap="internal">How to Edit Administrative Files in Trusted Extensions</olink>.</para>
</step><step><para>Type the full pathname of the <filename>dfstab</filename> file
into the editor.</para><screen># /zone/<replaceable>zone-name</replaceable>/etc/dfs/dfstab</screen>
</step><step><para>Add an entry to share a directory from that zone.</para><para>The
entry describes the directory from the perspective of the zone root path.
For example, the following entry shares an application's files at the label
of the containing zone:</para><screen>share -F nfs -o ro /<replaceable>viewdir</replaceable>/<replaceable>viewfiles</replaceable></screen>
</step>
</substeps>
</step><step><para>For each zone, share the directories by starting the zone.</para><para>In the global zone, run one of the following commands for each zone.
Each zone can share its directories in any of these ways. The actual sharing
occurs when each zone is brought into the <literal>ready</literal> or <literal>running</literal> state.</para><stepalternatives><step><para>If the zone is not in the running state and you do not want users
to log in to the server at the label of the zone, set the zone state to <literal>ready</literal>.</para><screen># zoneadm -z <replaceable>zone-name</replaceable> ready</screen>
</step><step><para>If the zone is not in the running state and users are allowed
to log in to the server at the label of the zone, boot the zone.</para><screen># zoneadm -z <replaceable>zone-name</replaceable> boot</screen>
</step><step><para>If the zone is already running, reboot the zone.</para><screen># zoneadm -z <replaceable>zone-name</replaceable> reboot</screen>
</step>
</stepalternatives>
</step><step><para>Display the directories that are shared from your system.</para><screen># <userinput>showmount -e</userinput></screen>
</step><step><para>To enable the client to mount the exported files, see <olink targetptr="txconf-41" remap="internal">How to NFS Mount Files in a Labeled Zone</olink>.</para>
</step>
</procedure><example id="managefiles-15"><title>Sharing the <filename class="directory">/export/share</filename> Directory
at the <constant>PUBLIC</constant> Label</title><para>For applications that run at the label <constant>PUBLIC</constant>,
the system administrator enables users to read the documentation in the <filename class="directory">/export/share</filename> directory of the <filename>public</filename> zone.
The zone named <filename>public</filename> runs at the label <constant>PUBLIC</constant>. </para><para>First, the administrator creates a <literal>public</literal> workspace
and edits the <filename>dfstab</filename> file.</para><screen># <userinput>mkdir -p /zone/public/etc/dfs</userinput>
# <userinput>/usr/dt/bin/trusted_edit /zone/public/etc/dfs/dfstab</userinput></screen><para>In the file, the administrator adds the following entry:</para><screen>## Sharing PUBLIC user manuals
share -F nfs -o ro /export/appdocs</screen><para>The administrator leaves the <literal>public</literal> workspace and
returns to the Trusted Path workspace. Because users are not allowed to log
in to this system, the administrator shares the files by putting the zone
in the ready state:</para><screen># zoneadm -z public ready</screen><para>Users can access the shared directories once the directories are mounted
on the users' systems.</para>
</example>
</task><task id="txconf-41"><title>How to NFS Mount Files in a Labeled Zone</title><indexterm><primary>administering</primary><secondary>file systems</secondary><tertiary>mounting</tertiary>
</indexterm><indexterm><primary>zones</primary><secondary><constant>net_mac_aware</constant> privilege</secondary>
</indexterm><tasksummary><para>In Trusted Extensions, a labeled zone manages the mounting of files in its
zone.</para><itemizedlist><para>Files from unlabeled and labeled hosts can be mounted on a Trusted Extensions labeled
host.</para><listitem><para>To mount the files read/write from a single-label host, the
assigned label of the remote host must be identical to the zone in which the
file is being mounted.</para>
</listitem><listitem><para>Files that are mounted by a higher-level zone are read-only.</para>
</listitem><listitem><para>In Trusted Extensions, the <filename>auto_home</filename> configuration
file is customized per zone. The file is named by zone name. For example,
a system with a global zone and a public zone has two <filename>auto_home</filename> files, <filename>auto_home_global</filename> and <filename>auto_home_public</filename>.</para>
</listitem>
</itemizedlist><itemizedlist><para>Trusted Extensions uses the same mounting interfaces as the Solaris OS:</para><listitem><para>To mount files at boot, use the <filename>/etc/vfstab</filename> file
in the labeled zone.</para>
</listitem><listitem><para>To mount files dynamically, use the <command>mount</command> command
in the labeled zone.</para>
</listitem><listitem><para>To automount home directories, use the <filename>auto_home_<replaceable>zone-name</replaceable></filename> files.</para>
</listitem><listitem><para>To automount other directories, use the standard automount
maps. If the automount maps are in LDAP, use LDAP commands to manage them.</para>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>You must be on the client system, in the zone at the label of the files
that you want to mount. Unless you are using the automounter, you must be
superuser, or be in the System Administrator role. To mount from lower-level
servers, the zone must be configured with the <constant>net_mac_aware</constant> privilege.</para>
</taskprerequisites><procedure remap="single-step"><step><para>To NFS mount files in a labeled zone, use the following procedures.</para><para>Most procedures include creating a workspace at a particular label.
To create a workspace, see <olink targetdoc="trssug" targetptr="shared-commontasks-37" remap="external"><citetitle remap="section">How to Add a Workspace at a Particular Label</citetitle> in <citetitle remap="book">Solaris Trusted Extensions User&rsquo;s Guide</citetitle></olink>.</para><stepalternatives><step><para>Mount files dynamically.</para><para>In the labeled zone, use
the <command>mount</command> command. For an example of mounting files dynamically,
see <olink targetptr="managefiles-28" remap="internal">Example&nbsp;17&ndash;3</olink>.</para>
</step><step><para>Mount files when the zone boots</para><para>In the labeled zone,
add the mounts to the <filename>vfstab</filename> file.</para><para>For examples of mounting files when a labeled zone boots, see <olink targetptr="managefiles-27" remap="internal">Example&nbsp;17&ndash;4</olink> and <olink targetptr="managefiles-29" remap="internal">Example&nbsp;17&ndash;5</olink>.</para>
</step><step><para>Mount home directories for systems that are administered with
LDAP.</para><substeps><step><para>At every label, add the user specifications to the <filename>auto_home_<replaceable>zone-name</replaceable></filename> files.</para>
</step><step><para>Then, use these files to populate the <filename>auto_home_<replaceable>zone-name</replaceable></filename> database on the LDAP server.</para>
</step>
</substeps><para>For an example, see <olink targetptr="managefiles-25" remap="internal">Example&nbsp;17&ndash;6</olink>.</para>
</step><step><para>Mount home directories for systems that are administered with
files.</para><substeps><step id="managefiles-step-homedirfiles-1"><para>Create and populate an <filename>/export/home/auto_home_<replaceable>lowest-labeled-zone-name</replaceable></filename> file.</para>
</step><step><para>Edit the <filename>/etc/auto_home_<replaceable>lowest-labeled-zone-name</replaceable></filename> file to point to the newly populated file.</para>
</step><step><para>Modify the <filename>/etc/auto_home_<replaceable>lowest-labeled-zone-name</replaceable></filename> file in every higher-level zone to point to the
file that you created in <olink targetptr="managefiles-step-homedirfiles-1" remap="internal">Step&nbsp;a</olink>.</para>
</step>
</substeps><para>For an example, see <olink targetptr="managefiles-33" remap="internal">Example&nbsp;17&ndash;7</olink>.</para>
</step>
</stepalternatives>
</step>
</procedure><example id="managefiles-28"><title>Mounting Files in a Labeled Zone by Using the <command>mount</command> Command</title><para>In this example, the system administrator mounts a remote file system
from a public zone. The public zone is on a multilevel server.</para><para>After assuming the System Administrator role, the administrator creates
a workspace at the label <constant>PUBLIC</constant>. In that workspace, the
administrator runs the <command>mount</command> command.</para><screen># <userinput>zonename</userinput>
public
# <userinput>mount -F nfs remote-sys:/zone/public/root/opt/docs  /opt/docs</userinput></screen><para>A single-label file server at the label <constant>PUBLIC</constant> also
contains documents to be mounted:</para><screen># <userinput>mount -F nfs public-sys:/publicdocs  /opt/publicdocs</userinput></screen><para>When the public zone of the <literal>remote-sys</literal> file server
is in the <literal>ready</literal> or <literal>running</literal> state, the <literal>remote-sys</literal> files successfully mount on this system. When the <literal>public-sys</literal> file server is running, the files successfully mount.</para>
</example><example id="managefiles-27"><title>Mounting Files Read/Write in a Labeled Zone by Modifying the <filename>vfstab</filename> File</title><para>In this example, the system administrator mounts two remote file systems
at the label <constant>PUBLIC</constant> in the local system's public zone
when the public zone boots. One file system mount is from a multilevel system,
and one file system mount is from a single-label system.</para><para>After assuming the System Administrator role, the administrator creates
a workspace at the label <constant>PUBLIC</constant>. In that workspace, the
administrator modifies the <filename>vfstab</filename> file in that zone.</para><screen>## Writable books directories at PUBLIC
remote-sys:/zone/public/root/opt/docs  - /opt/docs  nfs  no  yes  rw
public-sys:/publicdocs    - /opt/publicdocs  nfs no yes rw</screen><para>To access the files in the remote labeled zone of the multilevel system,
the <filename>vfstab</filename> entry uses the zone root path of the remote
system's public zone, <filename class="directory">/zone/public/root</filename>,
as the directory pathname to the directories to mount. The path to the single-label
system is identical to the path that would be used on a Solaris system.</para><para>In a terminal window at the label <constant>PUBLIC</constant>, the administrator
mounts the files.</para><screen># <userinput>mountall</userinput></screen>
</example><example id="managefiles-29"><title>Mounting Lower-Level Files in a Labeled Zone by Modifying the <filename>vfstab</filename> File</title><para>In this example, the system administrator mounts a remote file system
from a public zone in the local system's internal zone. After assuming the
System Administrator role, the administrator creates a workspace at the label <constant>INTERNAL</constant>, then modifies the <filename>vfstab</filename> file in
that zone.</para><screen>## Readable books directory at PUBLIC
## ro entry indicates that PUBLIC docs can never be mounted rw in internal zone
remote-sys:/zone/public/root/opt/docs  - /opt/docs  nfs  no  yes  ro</screen><para>To access the files in the remote labeled zone, the <filename>vfstab</filename> entry
uses the zone root path of the remote system's public zone, <filename class="directory">/zone/public/root</filename>, as the directory pathname
to the directories to mount.</para><para>From the perspective of a user in the internal zone, the files can be
accessed at <filename class="directory">/opt/docs</filename>.</para><para>In a terminal window at the label <constant>INTERNAL</constant>, the
administrator mounts the files.</para><screen># <userinput>mountall</userinput></screen>
</example><example id="managefiles-25"><title>Mounting Labeled Home Directories in a Network That Is Administered
by Using LDAP</title><para>In this example, the system administrator enables a new user, <literal>ikuk</literal>, to access her home directory at every label. This site uses two
home directory servers, and is administered by using LDAP. The second server
contains the home directories for the users <literal>jdoe</literal> and <literal>pkai</literal>. The new user is added to this list.</para><para>First, after assuming the System Administrator role, the administrator
modifies the <filename>auto_home_<replaceable>zone-name</replaceable></filename> files
in the <filename class="directory">/etc</filename> directory of the global
zone to include the new user on the second home directory server.</para><screen>## auto_home_global file
jdoe   homedir2-server:/export/home/jdoe
pkai   homedir2-server:/export/home/pkai
<userinput>ikuk   homedir2-server:/export/home/ikuk</userinput>
*      homedir-server:/export/home/&amp;</screen><screen>## auto_home_internal file
## Mount the home directory from the internal zone of the NFS server
jdoe   homedir2-server:/export/home/jdoe
pkai   homedir2-server:/export/home/pkai
<userinput>ikuk   homedir2-server:/export/home/ikuk</userinput>
*      homedir-server:/export/home/&amp;</screen><screen>## auto_home_public
## Mount the home directory from the public zone of the NFS server
jdoe   homedir2-server:/export/home/jdoe
pkai   homedir2-server:/export/home/pkai
<userinput>ikuk   homedir2-server:/export/home/ikuk</userinput>
*      homedir-server:/export/home/&amp;</screen><para>Next, to enable the users to log in at all labels, the administrator
repeats these edits for the <filename>auto_home_<replaceable>zone-name</replaceable></filename> files
at every label.</para><para>Finally, after modifying every <filename>auto_home_<replaceable>zone-name</replaceable></filename> file
on this system, the administrator uses these files to add entries to the LDAP
database. </para><para>Similar to the Solaris OS, the <literal>+auto_home_public</literal> entry
in the <filename>/etc/auto_home_<replaceable>zone-name</replaceable></filename> files
directs the automounter to the LDAP entries. The <filename>auto_home_<replaceable>zone-name</replaceable></filename> files on other systems on the network are
updated from the LDAP database.</para>
</example><example id="managefiles-33"><title>Mounting a Lower-Level Home Directory on a System That Is Administered
by Using Files</title><para>In this example, the system administrator enables users to access their
home directories at every label. The labels at the site are <constant>PUBLIC</constant>, <constant>INTERNAL</constant>, and <constant>NEEDTOKNOW</constant>. This site uses two
home directory servers, and is administered by using files. The second server
contains the home directories for the users <literal>jdoe</literal> and <literal>pkai</literal>.</para><para>To accomplish this task, the system administrator defines the public
zone NFS home directories in the public zone, and shares this configuration
with the internal and needtoknow zones.</para><para>First, after assuming the System Administrator role, the administrator
creates a workspace at the label <constant>PUBLIC</constant>. In this workspace,
the administrator creates a new file, <filename>/export/home/auto_home_public</filename>.
This file contains all the customized per-user NFS specification entries.</para><screen><userinput>## /export/home/auto_home_public file at PUBLIC label</userinput>
<userinput>jdoe   homedir2-server:/export/home/jdoe</userinput>
<userinput>pkai   homedir2-server:/export/home/pkai</userinput>
<userinput>*      homedir-server:/export/home/&amp;</userinput></screen><para>Second, the administrator modifies the <filename>/etc/auto_home_public</filename> file
to point to this new file.</para><screen>## /etc/auto_home_public file in the public zone
## Use /export/home/auto_home_public for the user entries
<userinput>##</userinput> +auto_home_public
<userinput>+ /export/home/auto_home_public</userinput></screen><para>This entry directs the automounter to use the contents of the local
file.</para><para>Third, the administrator similarly modifies the <filename>/etc/auto_home_public</filename> file in the internal and needtoknow zones. The administrator uses
the pathname to the public zone that is visible to the internal and needtoknow
zones.</para><screen>## /etc/auto_home_public file in the internal zone
## Use /zone/public/export/home/auto_home_public for PUBLIC user home dirs
<userinput>##</userinput> +auto_home_public
<userinput>+ /zone/public/export/home/auto_home_public</userinput></screen><screen>## /etc/auto_home_public file in the needtoknow zone
## Use /zone/public/export/home/auto_home_public for PUBLIC user home dirs
<userinput>##</userinput> +auto_home_public
<userinput>+ /zone/public/export/home/auto_home_public</userinput></screen><para>When the administrator adds the new user <literal>ikuk</literal>, the
addition is made to the <filename>/export/home/auto_home_public</filename> file
at the <constant>PUBLIC</constant> label.</para><screen>## /export/home/auto_home_public file at PUBLIC label
jdoe   homedir2-server:/export/home/jdoe
pkai   homedir2-server:/export/home/pkai
<userinput>ikuk   homedir2-server:/export/home/ikuk</userinput>
*      homedir-server:/export/home/&amp;</screen><para>The higher-level zones read down to obtain the per-user home directories
from the lower-level public zone.</para>
</example>
</task><task id="managefiles-20"><title>How to Troubleshoot Mount Failures in Trusted Extensions</title><indexterm><primary>mounting</primary><secondary>troubleshooting</secondary>
</indexterm><indexterm><primary>troubleshooting</primary><secondary>mounted file systems</secondary>
</indexterm><indexterm><primary>administering</primary><secondary>file systems</secondary><tertiary>troubleshooting</tertiary>
</indexterm><taskprerequisites><para>You must be in the zone at the label of the files that you want to mount.
You must be the superuser, or in the System Administrator role.</para>
</taskprerequisites><procedure><step><para>Check the security attributes of the NFS server.</para><para>Use
the Security Templates tool in the Solaris Management Console at the appropriate scope. For details,
see <olink targetptr="confsys-21" remap="internal">Initialize the Solaris Management
Console Server in Trusted Extensions</olink>.</para><substeps><step><para>Verify that the IP address of the NFS server is an assigned host
in one of the security templates.</para><para>The address might be directly
assigned, or indirectly assigned through a wildcard mechanism. The address
can be in a labeled template, or in an unlabeled template.</para>
</step><step><para>Check the label that the template assigns to the NFS server.</para><para>The label must be consistent with the label at which you are trying
to mount the files.</para>
</step>
</substeps>
</step><step><para>Check the label of the current zone.</para><para>If the label
is higher than the label of the mounted file system, then you cannot write
to the mount even if the remote file system is exported with read/write permissions.
You can only write to the mounted file system at the label of the mount.</para>
</step><step><para>To mount file systems from an NFS server that is running earlier
versions of Trusted Solaris software, do the following:</para><stepalternatives><step><para>For a Trusted Solaris 1 NFS server, use the <literal>vers=2</literal> and <literal>proto=udp</literal> options to the <command>mount</command> command.</para>
</step><step><para>For a Trusted Solaris 2.5.1 NFS server, use the <literal>vers=2</literal> and <literal>proto=udp</literal> options to the <command>mount</command> command.</para>
</step><step><para>For a Trusted Solaris 8 NFS server, use the <literal>vers=3</literal> and <literal>proto=udp</literal> options to the <command>mount</command> command.</para>
</step>
</stepalternatives><para>To mount file systems from any of these servers, the server must be
assigned to an unlabeled template.</para>
</step>
</procedure>
</task>
</sect1>
</chapter><?Pub *0000050731 0?>