<chapter id="smboverview"><title>Windows Interoperability (Overview)</title><highlights><para>This administration guide provides the information needed to integrate a <trademark>Solaris</trademark> Common Internet File System (CIFS) server into an existing Windows environment and also describes the Solaris CIFS client, which enables you to mount CIFS shares on Solaris systems.</para><para>Windows clients can access CIFS shares from the Solaris CIFS service as if they were made available from a Windows server. This guide focuses only on the information required to integrate the Solaris CIFS service and how to use the Solaris CIFS client. Windows topics are only covered when those topics affect the integration of the Solaris CIFS service into the Windows environment.</para><itemizedlist><para>This chapter covers the following topics:</para><listitem><para><olink targetptr="smbenvironmentoverview" remap="internal">The Solaris CIFS Service</olink></para>
</listitem><listitem><para><olink targetptr="processoverview" remap="internal">Configuring the Solaris CIFS Service &ndash; Process Overview</olink></para>
</listitem><listitem><para><olink targetptr="smbcmdsdaemonsfiles" remap="internal">Utilities and Files Associated With the Solaris CIFS Server and Client</olink></para>
</listitem><listitem><para><olink targetptr="namingdirectoryservices" remap="internal">Authentication, Directory, Naming, and Time Services</olink></para>
</listitem><listitem><para><olink targetptr="smbshares" remap="internal">CIFS Shares</olink></para>
</listitem><listitem><para><olink targetptr="localsmbgroupsusers" remap="internal">Local CIFS Groups</olink></para>
</listitem>
</itemizedlist><note><para>The <olink type="custom-text" targetptr="glossarycifs" remap="internal"><emphasis>Common Internet File System (CIFS)</emphasis></olink> is an enhanced version of the <olink type="custom-text" targetptr="glossarysmb" remap="internal"><emphasis>Server Message Block (SMB)</emphasis></olink> protocol, which allows CIFS clients to access files and resources on CIFS servers. The terms SMB and CIFS can be considered interchangeable.</para>
</note><caution><para>This is a beta release of the Solaris CIFS service for evaluation and <trademark>OpenSolaris</trademark> development. Do <emphasis>not</emphasis> use this service in production environments where service availability and data reliability are required.</para>
</caution>
</highlights><sect1 id="smbenvironmentoverview"><title>The Solaris CIFS Service</title><para>The Solaris Operating System (Solaris OS) has reached a new level of Windows interoperability with the introduction of an integrated <olink type="custom-text" targetptr="glossarysmbserver" remap="internal"><emphasis>CIFS service</emphasis></olink>. A Solaris server can now be an active participant in a Windows active directory domain and provide ubiquitous, cross-protocol file sharing through CIFS and NFS to clients in their native dialect.</para><para>The Solaris CIFS service allows a native Solaris system to serve files, by means of CIFS <olink type="custom-text" targetptr="glossaryshare" remap="internal"><emphasis>shares</emphasis></olink>, to CIFS/SMB enabled clients, such as Windows and Mac OS systems. By virtue of the Solaris CIFS service, a Windows client (or other CIFS client) can interoperate with the Solaris CIFS service as it would with a Windows server.</para><para>The Solaris CIFS service can operate in either workgroup mode or in domain mode. In workgroup mode, the Solaris CIFS service is responsible for authenticating users locally when access is requested to shared resources. This authentication process is referred to as local login. In domain mode, the Solaris CIFS service uses pass-through authentication, in which user authentication is delegated to a domain controller.</para><para>When a user is successfully authenticated, the Solaris CIFS service generates an access token using the security identifiers (SIDs) that represent the user's identity and the groups of which the user is a member. When the user requests access to files or resources from the service, the access token is used to determine access to files by cross-checking the token with the access control list (ACL) or permissions on files and resources. Solaris OS credentials have been enhanced to fully support Windows-style SIDs. In addition, file systems, such as ZFS, support Windows-style ACLs and access checking.</para><para>The Solaris OS is unique in that it can manage user identities simultaneously by using both traditional UIDs (and GIDs) and SIDs. When a user is authenticated through the CIFS service, the user's CIFS identity is mapped to the appropriate <trademark class="registered">UNIX</trademark> or <olink type="custom-text" targetptr="glossarynis" remap="internal"><emphasis>Network Information Service (NIS)</emphasis></olink> identity by using the <command>idmap</command> identity mapping service. If an existing UNIX or NIS identity exists, that identity is used. Otherwise, a temporary identity is generated using ephemeral UIDs and GIDs, as required. Ephemeral IDs are valid only within each Solaris OS instance and only until the system is rebooted. These IDs are never stored on disk or transmitted over the network. When an ACL is stored on disk through the CIFS service, the SIDs are used to generate the access control entries. Solaris utilities, such as <command>ls</command> and <command>chmod</command>, support ACL management.</para><para>For more information about how the Solaris OS manages user identities, see <olink targetptr="idmappingtasks" remap="internal">Chapter&nbsp;2, Identity Mapping Administration (Tasks)</olink>.</para><para>The following diagram shows how a Solaris file server can operate simultaneously with both NIS and Windows domains. The Windows domain controller provides CIFS authentication and naming services for CIFS clients and servers, while the NIS servers provide naming services for NFS clients and servers.</para><figure id="cifsenvfigure"><title>Solaris CIFS Environment</title><mediaobject><imageobject><imagedata entityref="SolarisCIFSDiagram"/>
</imageobject><textobject><simpara>Diagram showing the components and interactions in a Solaris CIFS environment.</simpara>
</textobject>
</mediaobject>
</figure><itemizedlist><para>The Solaris services described in this book include the following components:</para><listitem><para><olink targetptr="smbserver" remap="internal">Solaris CIFS Service</olink></para>
</listitem><listitem><para><olink targetptr="smbclient" remap="internal">Solaris CIFS Client</olink></para>
</listitem><listitem><para><olink targetptr="idmappingservice" remap="internal">Identity Mapping Service</olink></para>
</listitem>
</itemizedlist><sect2 id="smbserver"><title>Solaris CIFS Service</title><note><para>The <olink type="custom-text" targetptr="glossarysamba" remap="internal"><emphasis>Samba</emphasis></olink> and CIFS services cannot be used simultaneously on a single Solaris system. The Samba service must be disabled in order to run the Solaris CIFS service. For more information, see <olink targetptr="disablesambatask" remap="internal">How to Disable the Samba Service</olink>.</para>
</note><para>For a high-level overview of configuring the Solaris CIFS service, see <olink targetptr="processoverview" remap="internal">Configuring the Solaris CIFS Service &ndash; Process Overview</olink>. For information about configuring the service, see <olink targetptr="smbservertasks" remap="internal">Chapter&nbsp;3, Solaris CIFS Service Administration (Tasks)</olink>. For more information about the Solaris CIFS service, see the <olink targetdoc="refman1m" targetptr="smbadm-1m" remap="external"><citerefentry><refentrytitle>smbadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>, <olink targetdoc="refman1m" targetptr="smbd-1m" remap="external"><citerefentry><refentrytitle>smbd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>, <olink targetdoc="refman1m" targetptr="smbstat-1m" remap="external"><citerefentry><refentrytitle>smbstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>, <olink targetdoc="refman4" targetptr="smb-4" remap="external"><citerefentry><refentrytitle>smb</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink>, <olink targetdoc="refman4" targetptr="smbautohome-4" remap="external"><citerefentry><refentrytitle>smbautohome</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink>,  and <olink targetdoc="refman5" targetptr="pam-smb-passwd-5" remap="external"><citerefentry><refentrytitle>pam_smb_passwd</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man pages.</para><itemizedlist><para>The CIFS features offered by the Solaris service depend on the file system being shared. To fully support the Solaris CIFS service, a file system should support the following features:</para><listitem><para>If the file system supports the <literal>archive</literal>, <literal>hidden</literal>, <literal>read-only</literal>, and <literal>system</literal> attributes, these attributes are made available as the DOS attributes available on Windows systems. ZFS supports these attributes.</para>
</listitem><listitem><para>If the file system supports Solaris extended attributes, they are made available as NTFS alternate data streams.</para>
</listitem><listitem><para>The case-sensitivity capabilities of the file system are made available to CIFS clients. To support both Windows-style access and POSIX access, a file system should support mixed-mode, which is simultaneous support for case-sensitive and case-insensitive name operations.</para><para>The Solaris OS supports both the NFS and CIFS protocols, which have different expectations regarding case behavior. For instance, Windows clients typically expect case-insensitive behavior while local applications and NFS clients typically expect case-sensitive behavior. The ZFS file system supports three case modes: case-sensitive, case-insensitive, and mixed. The ZFS file system can indicate case conflicts when in mixed mode. Mixed mode is recommended for maximum multi-protocol compatibility.</para>
</listitem><listitem><para>To provide full Windows <olink type="custom-text" targetptr="glossaryacl" remap="internal"><emphasis>access control list (ACL)</emphasis></olink> support, file systems should be able to store SIDs and they should at least support NFSv4 ACLs.</para>
</listitem>
</itemizedlist><para>For information about the supported features of the UFS and ZFS file systems, see the <olink targetdoc="refman7" targetptr="ufs-7fs" remap="external"><citerefentry><refentrytitle>ufs</refentrytitle><manvolnum>7FS</manvolnum></citerefentry></olink> man page and the <olink targetdoc="zfsadmin" remap="external"><citetitle remap="book">Solaris ZFS Administration Guide</citetitle></olink>, respectively.</para><para>For information about how to access CIFS shares from your client, refer to the client documentation.</para>
</sect2><sect2 id="smbclient"><title>Solaris CIFS Client</title><para>The SMB protocol is the natural file-sharing protocol used by Windows and Mac OS systems. Samba implements the SMB protocol for UNIX and Linux systems. The Solaris CIFS client is a Solaris virtual file system that provides access to files and directories from the CIFS service.</para><para>By using the Solaris CIFS client, a user can mount remote CIFS shares (directories) on his Solaris system to get read-write access to previously inaccessible files. The Solaris CIFS client does not include the ability to print by means of CIFS or the ability to access CIFS resources other than files and directories. The Solaris CIFS client enables an unprivileged user to mount and unmount shares on directories he owns.</para><para>For more information about how to use the Solaris CIFS client to access shares, see <olink targetptr="smbclienttasks" remap="internal">Chapter&nbsp;4, Solaris CIFS Client Administration (Tasks)</olink>, and the <olink targetdoc="refman1" targetptr="smbutil-1" remap="external"><citerefentry><refentrytitle>smbutil</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink>, <olink targetdoc="refman1m" targetptr="mount-smbfs-1m" remap="external"><citerefentry><refentrytitle>mount_smbfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>, <olink targetdoc="refman4" targetptr="nsmbrc-4" remap="external"><citerefentry><refentrytitle>nsmbrc</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink>, and <olink targetdoc="refman5" targetptr="pam-smbfs-login-5" remap="external"><citerefentry><refentrytitle>pam_smbfs_login</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man pages.</para>
</sect2><sect2 id="idmappingservice"><title>Identity Mapping Service</title><para>The Solaris OS includes an identity mapping service that enables you to map identities between Solaris systems and Windows systems.</para><itemizedlist><para>This identity mapping service supports the following types of mappings between Windows security identities (SIDs) and Solaris user IDs and group IDs (UIDs and GIDs):</para><listitem><para><emphasis role="strong">Name-based mapping.</emphasis> Maps Windows and Solaris users and groups by name in the following ways:</para><itemizedlist><listitem><para><emphasis role="strong">Directory-based mapping.</emphasis> Uses name mapping information that is stored in user or group objects in the Active Directory (AD) and/or the native LDAP directory service to map users and groups.</para>
</listitem><listitem><para><emphasis role="strong">Rule-based mapping.</emphasis> An administrator uses rules to map Windows and Solaris users and groups by name.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para><emphasis role="strong">Ephemeral ID mapping.</emphasis> A UID or GID is dynamically allocated as needed for every SID that is not already mapped by name. Ephemeral ID mapping is used by default.</para>
</listitem><listitem><para><emphasis role="strong">Local SID mapping.</emphasis> A non-ephemeral UID or GID is mapped to an algorithmically generated local SID.</para>
</listitem>
</itemizedlist><para>The <command>idmap</command> utility can be used to create and manage the name-based mappings and to monitor the mappings in effect.</para><para>For more information about mapping user and group identities, see <olink targetptr="mapusergroupidentities" remap="internal">Mapping User and Group Identities</olink>. For information about how to determine your identity mapping strategy, see <olink targetptr="createidmappingstrategy" remap="internal">Creating Your Identity Mapping Strategy</olink>. For instructions on how to use the <command>idmap</command> command, see <olink targetptr="managedirbasedusergroupmapstm" remap="internal">Managing Directory-Based Identity Mapping for Users and Groups (Task Map)</olink>, <olink targetptr="manageusergroupmapstm" remap="internal">Managing Rule-Based Identity Mapping for Users and Groups (Task Map)</olink>, and the <olink targetdoc="refman1m" targetptr="idmap-1m" remap="external"><citerefentry><refentrytitle>idmap</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="smbconfigpropertymanagement"><title>Managing Solaris CIFS Configuration Properties</title><para>The Solaris CIFS service and the Solaris CIFS client use the <command>sharectl</command> command to manage configuration properties. For descriptions of the Solaris CIFS service properties, see the <olink targetdoc="refman1m" targetptr="sharectl-1m" remap="external"><citerefentry><refentrytitle>sharectl</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman4" targetptr="smb-4" remap="external"><citerefentry><refentrytitle>smb</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man pages. For descriptions of the Solaris CIFS client properties, see the <olink targetdoc="refman4" targetptr="nsmbrc-4" remap="external"><citerefentry><refentrytitle>nsmbrc</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para><para>The Solaris CIFS properties and their values are stored in the Service Management Facility (SMF). For more information about SMF, see <olink targetdoc="sysadv1" targetptr="hbrunlevels-25516" remap="external">Chapter 15, <citetitle remap="chapter">Managing Services (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><para>The <command>sharectl</command> command is used throughout the configuration process to set and view properties. This command and examples of its use are described in <olink targetptr="smbservertasks" remap="internal">Chapter&nbsp;3, Solaris CIFS Service Administration (Tasks)</olink>. The <command>sharectl</command> command is also used by the Solaris CIFS client to configure the global environment. For more information, see <olink targetptr="smbclienttasks" remap="internal">Chapter&nbsp;4, Solaris CIFS Client Administration (Tasks)</olink>.</para>
</sect2>
</sect1><sect1 id="processoverview"><title>Configuring the Solaris CIFS Service &ndash; Process Overview</title><para>This section describes the high-level process for configuring the Solaris CIFS service.</para><orderedlist><listitem><para>Determine your identity mapping strategy.</para><para>See <olink targetptr="createidmappingstrategy" remap="internal">Creating Your Identity Mapping Strategy</olink>.</para>
</listitem><listitem><para>Configure the Solaris CIFS service as a client to the various services that are used in your environment.</para><itemizedlist><listitem><para>For WINS, see <olink targetptr="settingupwinstask" remap="internal">How to Configure WINS</olink>.</para>
</listitem>
</itemizedlist><para>Your Solaris system might need to be a client of other services that are available in your environment.</para><itemizedlist><para>The following list shows these other services and points to information about how to configure your Solaris system as a client of that service.</para><listitem><para>For DNS, see <olink targetdoc="sysadv5" remap="external"><citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>.</para>
</listitem><listitem><para>For Kerberos, see <olink targetdoc="sysadv6" targetptr="seamtask-435" remap="external"><citetitle remap="section">Configuring Kerberos Clients (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</listitem><listitem><para>For LDAP, see <olink targetdoc="sysadv5" targetptr="clientsetup-1" remap="external">Chapter 12, <citetitle remap="chapter">Setting Up LDAP Clients (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>.</para>
</listitem><listitem><para>For NIS, see <olink targetdoc="sysadv5" targetptr="cnis1-19866" remap="external"><citetitle remap="section">Setting Up NIS Clients</citetitle> in <citetitle remap="book">System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)</citetitle></olink>.</para>
</listitem><listitem><para>For NTP, see <olink targetdoc="sysadv4" targetptr="time-9" remap="external"><citetitle remap="section">How to Set Up an NTP Client</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para>Determine whether you want the Solaris CIFS service to join an existing <olink type="custom-text" targetptr="glossarywindowsdomain" remap="internal"><emphasis>Windows domain</emphasis></olink> or a <olink type="custom-text" targetptr="glossarywindowsworkgroup" remap="internal"><emphasis>Windows workgroup</emphasis></olink>.</para><itemizedlist><listitem><para>To join a domain, see <olink targetptr="configuredomainmodetask" remap="internal">How to Configure the Solaris CIFS Service in Domain Mode</olink>.</para>
</listitem><listitem><para>To join a workgroup, see <olink targetptr="configureworkgroupmodetask" remap="internal">How to Configure the Solaris CIFS Service in Workgroup Mode</olink>.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para>Define one or more CIFS shares.</para><para>See <olink targetptr="managingsmbsharestm" remap="internal">Managing CIFS Shares (Task Map)</olink>.</para>
</listitem>
</orderedlist>
</sect1><sect1 id="smbcmdsdaemonsfiles"><title>Utilities and Files Associated With the Solaris CIFS Server and Client</title><itemizedlist><para>This section describes the CIFS utilities and files that are used by the CIFS service and client.</para><listitem><para><olink targetptr="smbcommands" remap="internal">Solaris CIFS Utilities</olink></para>
</listitem><listitem><para><olink targetptr="smbdaemons" remap="internal">Solaris CIFS Service Daemon</olink></para>
</listitem><listitem><para><olink targetptr="smbfiles" remap="internal">Solaris CIFS Files</olink></para>
</listitem>
</itemizedlist><note><para>The Solaris CIFS service is only supported in the global zone.</para>
</note><sect2 id="smbcommands"><title>Solaris CIFS Utilities</title><itemizedlist><para>These utilities must be run as superuser or with specific privileges to be fully effective, but requests for information can be made by all users:</para><listitem><para><olink targetptr="mountsmbfscommand" remap="internal">mount_smbfs Command</olink></para>
</listitem><listitem><para><olink targetptr="sharectlcommand" remap="internal">sharectl Command</olink></para>
</listitem><listitem><para><olink targetptr="sharemgrcommand" remap="internal">sharemgr Command</olink></para>
</listitem><listitem><para><olink targetptr="smbadmcommand" remap="internal">smbadm Command</olink></para>
</listitem><listitem><para><olink targetptr="smbstatcommand" remap="internal">smbstat Command</olink></para>
</listitem><listitem><para><olink targetptr="smbutilcommand" remap="internal">smbutil Command</olink></para>
</listitem><listitem><para><olink targetptr="umountsmbfscommand" remap="internal">umount_smbfs Command</olink></para>
</listitem>
</itemizedlist><sect3 id="mountsmbfscommand"><title><command>mount_smbfs</command> Command</title><para>With this command, you can attach a named CIFS share to a specified mount point. The <command>mount_smbfs</command> command enables you to mount a CIFS share to a directory you own without having to become superuser.</para><itemizedlist><para>For more information, see the following:</para><listitem><para><olink targetptr="mountsharetask" remap="internal">How to Mount a Share on a Directory You Own</olink></para>
</listitem><listitem><para><olink targetptr="setupmultiusersharetask" remap="internal">How to Mount a Multiuser Share</olink></para>
</listitem><listitem><para><olink targetptr="automountsharetask" remap="internal">How to Add a Direct Automounter Entry for a CIFS Share</olink></para>
</listitem>
</itemizedlist><para>Also, see the <olink targetdoc="refman1m" targetptr="mount-smbfs-1m" remap="external"><citerefentry><refentrytitle>mount_smbfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="sharectlcommand"><title><command>sharectl</command> Command</title><itemizedlist><para>The <command>sharectl</command> utility is an administrative tool that enables you to configure and manage file-sharing protocols, such as CIFS and NFS. You can use this command to do the following:</para><listitem><para>Set client and server operational properties</para>
</listitem><listitem><para>Display property values for a specific protocol</para>
</listitem><listitem><para>Obtain the status of a protocol</para>
</listitem>
</itemizedlist><itemizedlist><para>For procedures that use the <command>sharectl</command> utility, see the following:</para><listitem><para><olink targetptr="settingupwinstask" remap="internal">How to Configure WINS</olink></para>
</listitem><listitem><para><olink targetptr="customizeglobalenvtask" remap="internal">How to Customize the Global Solaris CIFS Environment</olink></para>
</listitem><listitem><para><olink targetptr="viewglobalenvtask" remap="internal">How to View the Global Solaris CIFS Environment Property Settings</olink></para>
</listitem>
</itemizedlist><para>Also, see the <olink targetdoc="refman1m" targetptr="sharectl-1m" remap="external"><citerefentry><refentrytitle>sharectl</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="sharemgrcommand"><title><command>sharemgr</command> Command</title><itemizedlist><para>The <command>sharemgr</command> utility is an administrative tool that provides an enhanced method of sharing files and performing related tasks. The <command>sharemgr</command> utility introduces the following concepts:</para><listitem><para><emphasis role="strong">Share.</emphasis> One or more files or directories in a share group.</para>
</listitem><listitem><para><emphasis role="strong">Share group.</emphasis> A container of one or more shared files or directories.</para><itemizedlist><para>Note the following:</para><listitem><para>Options for <command>sharemgr</command> are set to a share group, not to a specific file or directory. All options apply to each file and directory in the group.</para>
</listitem><listitem><para>A file or directory can only be assigned to one share group. However, you can move a file or directory from one group to another.</para>
</listitem><listitem><para>A share group can be used by multiple file system types. For example, the share group <literal>my_group</literal> could be used by NFS and ZFS and be assigned one set of options for NFS and another set of options for ZFS.</para><note><para>When a share is managed by ZFS, <command>sharemgr</command> identifies the share and lists it in a <literal>zfs</literal> share group.</para>
</note>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist><note><para>The <command>sharemgr</command> utility provides a unique way of checking the validity of a desired configuration. The <option>n</option> option allows you to test the validity of the options and properties you want to use with a specific subcommand. The test does not change your configuration. For example, if you use the <option>n</option> option with the subcommand <command>create</command>, no share group is created.</para>
</note><para>You can also use the ZFS <literal>sharesmb</literal> property to configure SMB sharing. For more information, see <olink targetptr="createstaticsmbsharezfstask" remap="internal">How to Create a CIFS Share (zfs)</olink> and the <olink targetdoc="refman1m" targetptr="zfs-1m" remap="external"><citerefentry><refentrytitle>zfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman1m" targetptr="zpool-1m" remap="external"><citerefentry><refentrytitle>zpool</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages.</para><itemizedlist><para>For procedures that use the <command>sharemgr</command> utility, see the following:</para><listitem><para><olink targetptr="createstaticsmbsharetask" remap="internal">How to Create a CIFS Share (sharemgr)</olink></para>
</listitem><listitem><para><olink targetptr="modifysmbsharetask" remap="internal">How to Modify CIFS Share Properties (sharemgr)</olink></para>
</listitem><listitem><para><olink targetptr="removesmbsharetask" remap="internal">How to Remove a CIFS Share (sharemgr)</olink></para>
</listitem>
</itemizedlist><para>Also, see the <olink targetdoc="refman1m" targetptr="sharemgr-1m" remap="external"><citerefentry><refentrytitle>sharemgr</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="smbadmcommand"><title><command>smbadm</command> Command</title><para>You can use the <command>smbadm</command> command to manage domain membership of the Solaris CIFS service. For instance, you can have the Solaris CIFS service use domain mode or workgroup mode. The <command>smbadm</command> command also enables you to configure CIFS local groups. CIFS local groups can be used when Windows accounts must be members of some local groups and when Windows-style privileges must be granted. Solaris local groups cannot provide these functionalities.</para><itemizedlist><para>For procedures that use the <command>smbadm</command> utility, see the following:</para><listitem><para><olink targetptr="configuredomainmodetask" remap="internal">How to Configure the Solaris CIFS Service in Domain Mode</olink></para>
</listitem><listitem><para><olink targetptr="configureworkgroupmodetask" remap="internal">How to Configure the Solaris CIFS Service in Workgroup Mode</olink></para>
</listitem><listitem><para><olink targetptr="createsmbgrouptask" remap="internal">How to Create a CIFS Group</olink></para>
</listitem><listitem><para><olink targetptr="addmembertosmbgrouptask" remap="internal">How to Add a Member to a CIFS Group</olink></para>
</listitem><listitem><para><olink targetptr="removememberfromsmbgrouptask" remap="internal">How to Remove a Member From a CIFS Group</olink></para>
</listitem><listitem><para><olink targetptr="modifysmbgroupprivstask" remap="internal">How to Modify CIFS Group Properties</olink></para>
</listitem>
</itemizedlist><para>Also, see the <olink targetdoc="refman1m" targetptr="smbadm-1m" remap="external"><citerefentry><refentrytitle>smbadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="smbstatcommand"><title><command>smbstat</command> Command</title><para>You can use the <command>smbstat</command> command to show statistical information about the <command>smbd</command> server. By default, the <command>smbstat</command> command shows general information about the CIFS service as well as dispatched CIFS request counters. For more information, see the <olink targetdoc="refman1m" targetptr="smbstat-1m" remap="external"><citerefentry><refentrytitle>smbstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para><para>The <command>kstat</command> command can be used to report on kernel CIFS statistics on a periodic basis and also to specify information about individual CIFS statistics. For more information, see the <olink targetdoc="refman1m" targetptr="kstat-1m" remap="external"><citerefentry><refentrytitle>kstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="smbutilcommand"><title><command>smbutil</command> Command</title><itemizedlist><para>Use the <command>smbutil</command> command to perform the following CIFS client tasks:</para><listitem><para>View the shares available for mounting from a particular CIFS server</para>
</listitem><listitem><para>Generate a hash of a password for storing in a file such as <filename>$HOME/.nsmbrc</filename></para>
</listitem><listitem><para>Create or remove persistent passwords used to authenticate to CIFS servers</para>
</listitem><listitem><para>Resolve a name to an IP address for a server that uses CIFS over NetBIOS, not TCP</para>
</listitem><listitem><para>Resolve the specified server to the NetBIOS workgroup and system name</para>
</listitem>
</itemizedlist><itemizedlist><para>For procedures that use the <command>smbutil</command> utility, see the following:</para><listitem><para><olink targetptr="findsharestask" remap="internal">How to Find Available Shares on a Known File Server</olink></para>
</listitem><listitem><para><olink targetptr="mountsharetask" remap="internal">How to Mount a Share on a Directory You Own</olink></para>
</listitem><listitem><para><olink targetptr="storepasswordtask" remap="internal">How to Store a Persistent Password</olink></para>
</listitem><listitem><para><olink targetptr="pammoduletask" remap="internal">How to Configure the PAM Module to Store a Persistent Password</olink></para>
</listitem><listitem><para><olink targetptr="deletepasswordtask" remap="internal">How to Delete a Persistent Password</olink></para>
</listitem><listitem><para><olink targetptr="setupmultiusersharetask" remap="internal">How to Mount a Multiuser Share</olink></para>
</listitem><listitem><para><olink targetptr="deleteallpasswordstask" remap="internal">How to Delete All Persistent Passwords</olink></para>
</listitem>
</itemizedlist><para>Also, see the <olink targetdoc="refman1" targetptr="smbutil-1" remap="external"><citerefentry><refentrytitle>smbutil</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="umountsmbfscommand"><title><command>umount_smbfs</command> Command</title><para>With this command, you can remove a named CIFS share from a mount point.</para><para>For more information, see <olink targetptr="unmountsharetask" remap="internal">How to Unmount a Share From a Directory You Own</olink>, and the <olink targetdoc="refman1m" targetptr="mount-smbfs-1m" remap="external"><citerefentry><refentrytitle>mount_smbfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect3>
</sect2><sect2 id="smbdaemons"><title>Solaris CIFS Service Daemon</title><para>The <command>smbd</command> daemon supports CIFS activities on Solaris systems. The <command>smbd</command> daemon provides the gateway to the various user space components that support non-file I/O CIFS services. Similar to the NFS kernel service, the SMB kernel module provides SMB file I/O services directly between the network interface and the virtual file system (VFS) within the kernel. Whenever a non-file I/O request is received, such as a user authentication or an MS-RPC named pipe request, it is passed to <command>smbd</command> for processing in user space. Requests that require interaction with a domain controller are passed to the SMB Redirector, which provides a simple user space SMB client for IPC communication.</para><para>The <command>smbd</command> daemon depends on the <command>idmapd</command> daemon. For more information about the identity mapping service, see <olink targetptr="idmappingtasks" remap="internal">Chapter&nbsp;2, Identity Mapping Administration (Tasks)</olink>, and the <olink targetdoc="refman1m" targetptr="idmap-1m" remap="external"><citerefentry><refentrytitle>idmap</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman1m" targetptr="idmapd-1m" remap="external"><citerefentry><refentrytitle>idmapd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages.</para><para><command>smbd</command> is part of the <literal>svc:/network/smb/server:default</literal> service.</para><para>For more information, see the <olink targetdoc="refman1m" targetptr="smbd-1m" remap="external"><citerefentry><refentrytitle>smbd</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</sect2><sect2 id="smbfiles"><title>Solaris CIFS Files</title><itemizedlist><para>The following files support CIFS activities on any computer:</para><listitem><para><filename>/etc/auto_direct</filename></para>
</listitem><listitem><para><filename>/etc/smbautohome</filename></para>
</listitem><listitem><para><filename>$HOME/.nsmbrc</filename></para>
</listitem>
</itemizedlist><sect3 id="autodirectfile"><title><filename>/etc/auto_direct</filename> File</title><para>Use the <filename>/etc/auto_direct</filename> file to automatically mount a CIFS share when a user accesses the mount point. To use the automount feature, you must store a persistent password for authentication to mount the share. See <olink targetptr="storepasswordtask" remap="internal">How to Store a Persistent Password</olink>.</para><para>For instructions and examples, see <olink targetptr="automountsharetask" remap="internal">How to Add a Direct Automounter Entry for a CIFS Share</olink>.</para>
</sect3><sect3 id="smbautohomefile"><title><filename>/etc/smbautohome</filename> File</title><para>The <filename>/etc/smbautohome</filename> file is used to define the automatic sharing rules to be applied when a user connects to the Solaris CIFS service. For more information, see <olink targetptr="autohomeshares" remap="internal">Autohome Shares</olink> and the <olink targetdoc="refman4" targetptr="smbautohome-4" remap="external"><citerefentry><refentrytitle>smbautohome</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect3><sect3 id="nsmbrcfile"><title><filename>$HOME/.nsmbrc</filename> File</title><para>You can use the <filename>$HOME/.nsmbrc</filename> file to override global behavior of the Solaris CIFS client. Global values are set in the Service Management Facility (SMF). The <filename>.nsmbrc</filename> file is used to customize the behavior of the Solaris CIFS client on a per-user basis.</para><para>By default, settings in the <filename>$HOME/.nsmbrc</filename> file are used unless they have security implications, in which case the stronger security setting is used.</para><itemizedlist><para>For procedures that refer to the <filename>$HOME/.nsmbrc</filename> file, see the following:</para><listitem><para><olink targetptr="customizeenvtask" remap="internal">How to Customize Your Solaris CIFS Environment</olink></para>
</listitem><listitem><para><olink targetptr="customizeglobalenvtask" remap="internal">How to Customize the Global Solaris CIFS Environment</olink></para>
</listitem><listitem><para><olink targetptr="viewglobalenvtask" remap="internal">How to View the Global Solaris CIFS Environment Property Settings</olink></para>
</listitem>
</itemizedlist><para>Also, see the <olink targetdoc="refman4" targetptr="nsmbrc-4" remap="external"><citerefentry><refentrytitle>nsmbrc</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</sect3>
</sect2>
</sect1><sect1 id="namingdirectoryservices"><title>Authentication, Directory, Naming, and Time Services</title><para>This section describes the various services that the Solaris CIFS service interoperates with as a client.</para><itemizedlist><para>The Solaris CIFS service interoperates with a variety of naming services that are used by Windows and Solaris system networks. These naming services include the following:</para><listitem><para><emphasis role="strong">Active Directory Service (AD).</emphasis> AD is a Windows 2000 directory service that is integrated with the <olink type="custom-text" targetptr="glossarydns" remap="internal"><emphasis>Domain Name System (DNS)</emphasis></olink>. AD runs only on domain controllers. In addition to storing and making data available, AD protects network objects from unauthorized access and replicates objects across a network so that data is not lost if one domain controller fails.</para>
</listitem><listitem><para><emphasis role="strong">Domain Name System (DNS).</emphasis> DNS resolves host names to Internet Protocol (IP) addresses for the system. This service enables you to identify a server by either its IP address or its name.</para>
</listitem><listitem><para><emphasis role="strong">Dynamic DNS (DDNS).</emphasis> DDNS is provided with AD and enables a client to dynamically update its entries in the DNS database.</para>
</listitem><listitem><para><emphasis role="strong">Lightweight Data Access Protocol (LDAP).</emphasis> LDAP is a standard, extensible directory access protocol that enables clients and servers that use LDAP naming services to communicate with each other.</para>
</listitem><listitem><para><emphasis role="strong">Network Information Service (NIS).</emphasis> NIS is a naming service that focuses on making network administration more manageable by providing centralized control over a variety of network information. NIS stores information about the network, machine names and addresses, users, and network services.</para>
</listitem><listitem><para><emphasis role="strong">Network Time Protocol (NTP).</emphasis> NTP is a protocol that enables a client to automatically synchronize its system clock with a time server. The clock is synchronized each time the client is booted and any time it contacts the time server.</para>
</listitem><listitem><para><emphasis role="strong">Windows Internet Naming Service (WINS).</emphasis> A <olink type="custom-text" targetptr="glossarywins" remap="internal"><emphasis>WINS</emphasis></olink> server resolves <olink type="custom-text" targetptr="glossarynetbiosname" remap="internal"><emphasis>NetBIOS names</emphasis></olink> to IP addresses, which allows computers on your network to locate other NetBIOS devices more quickly and efficiently. The WINS server runs on a Windows system. The WINS server performs a similar function for Windows environments as a DNS server does for UNIX environments. For more information, see <olink targetptr="settingupwinstask" remap="internal">How to Configure WINS</olink>.</para>
</listitem>
</itemizedlist>
</sect1><sect1 id="smbshares"><title>CIFS Shares</title><para>A shared resource, or <olink type="custom-text" targetptr="glossaryshare" remap="internal"><emphasis>share</emphasis></olink>, is a local resource on a server that is accessible to CIFS clients on the network. For the Solaris CIFS service, a share is typically a directory. Each share is identified by a name on the network. A CIFS client sees the share as a complete entity on the CIFS server, and does not see the local directory path to the share on the server.</para><note><para>A share and a directory are independent entities. Removing a share does not affect the underlying directory.</para>
</note><para>Shares are commonly used to provide network access to home directories on a network file server. Each user is assigned a home directory. A share is persistent and remains defined regardless of whether users are connected to the server.</para><para>The Solaris CIFS service provides a special kind of share called an autohome CIFS share. An <olink type="custom-text" targetptr="glossaryautohomeshare" remap="internal"><emphasis>autohome share</emphasis></olink> is a transient share of a user's home directory that is created when a user logs in and removed when the user logs out.</para><para>When a user browses the system, only statically defined shares and his autohome share will be listed.</para><sect2 id="autohomeshares"><title>Autohome Shares</title><para>The autohome share feature eliminates the administrative task of defining and maintaining home directory shares for each user that accesses the system through the SMB protocol. The system creates autohome shares when a user logs in, and removes them when the user logs out. This process reduces the administrative effort needed to maintain user accounts, and increases the efficiency of service resources.</para><para>For example, if <filename>/home</filename> is a home directory that contains subdirectories for users <literal>bob</literal> and <literal>sally</literal>, you can manually define the shares as follows:</para><variablelist termlength="medium"><varlistentry><term><literal>bob</literal></term><listitem><para><filename>/home/bob</filename></para>
</listitem>
</varlistentry><varlistentry><term><literal>sally</literal></term><listitem><para><filename>/home/sally</filename></para>
</listitem>
</varlistentry>
</variablelist><para>However, defining and maintaining directory shares in this way for each user is inconvenient. Instead, you can use the autohome feature.</para><note><para>The Solaris CIFS client does not support autohome shares.</para>
</note><para>To configure the autohome feature, you need to specify autohome share rules. For example, if a user's home directory is <filename>/fort/sally</filename>, the autohome path is <filename>/fort</filename>. The temporary share is named <filename>sally</filename>. Note that the user's home directory name must be the same as the user's login name. See <olink targetptr="createspecificautohomeshareruletask" remap="internal">How to Create a Specific Autohome Share Rule</olink>.</para><para>When a user logs in, the Solaris CIFS service looks for a subdirectory that matches the user's name based on any rules that have been specified. If the service finds a match and if that share does not already exist, the subdirectory is added as a transient share. When the user logs out, the service removes that transient share.</para><para>Some Windows clients log a user out after 15 minutes of inactivity, which results in the autohome share disappearing from the list of defined shares. This behavior is expected for CIFS autohome shares. Even after a CIFS autohome share is removed, the share reappears when the user attempts to access the system (for example, in an Explorer window).</para><note><para>All autohome shares are removed when the Solaris CIFS service is restarted.</para>
</note><sect3 id="autohomeentries"><title>Autohome Entries</title><para>The Solaris CIFS service can automatically share home directories when a CIFS client connects. The autohome map file, <filename>/etc/smbautohome</filename>, uses the search options and rules to determine whether to share a home directory when a CIFS client connects to the service.</para><para>For example, the following entries specify the autohome rules for a particular environment:</para><screen>+nsswitch	    dn=ads,dn=sun,dn=com,ou=users
jane    /home/?/&amp;    dn=ads,dn=sun,dn=com,ou=users</screen><para>The <literal>nsswitch</literal> autohome entry uses the naming service to match users to home directories. The second autohome entry specifies that the home directory for user <literal>jane</literal> is <filename>/home/j/jane</filename>.</para><sect4 id="autohomemapentryformat"><title>Autohome Map Entry Format</title><para>A map entry, also referred to as a mapping, uses the following format:</para><screen><replaceable>key</replaceable> <replaceable>location</replaceable> [ <replaceable>container</replaceable> ]</screen><para><replaceable>key</replaceable> is a user name, <replaceable>location</replaceable> is the fully qualified path for the user's home directory, and <replaceable>container</replaceable> is an optional AD container.</para><para>If you intend to publish the share in AD, you <emphasis>must</emphasis> specify an AD container name, which is specified as a comma-separated list of attribute name-value pairs. The attributes use the <olink type="custom-text" targetptr="glossaryldap" remap="internal"><emphasis>Lightweight Data Access Protocol (LDAP)</emphasis></olink> distinguished name (DN) or relative distinguished name (RDN) format.</para><itemizedlist><para>The DN or RDN must be specified in LDAP format by using the following attribute types:</para><listitem><para><literal>cn=</literal> represents the common name</para>
</listitem><listitem><para><literal>ou=</literal> represents the organizational unit</para>
</listitem><listitem><para><literal>dc=</literal> represents the domain component</para>
</listitem>
</itemizedlist><note><para>The attribute type that is used to describe an object's RDN is called a <emphasis>naming attribute</emphasis>.</para><itemizedlist><para>AD uses the naming attributes as follows:</para><listitem><para><literal>cn</literal> for the <classname>user</classname> object
class</para>
</listitem><listitem><para><literal>ou</literal> for the <classname>OU</classname> (organizational unit) object class</para>
</listitem><listitem><para><literal>dc</literal> for the <classname>domainDns</classname> object class</para>
</listitem>
</itemizedlist>
</note>
</sect4><sect4 id="autohomemapkeysubs"><title>Autohome Map Key Substitution</title><itemizedlist><para>The autohome feature supports the following wildcard substitutions for the value of the key field:</para><listitem><para>The ampersand character (<literal>&amp;</literal>) is expanded to the value of the key field for the entry in which it occurs. In the following example, <literal>&amp;</literal> expands to <literal>jane</literal>:</para><programlisting>jane /home/&amp;</programlisting>
</listitem><listitem><para>The question mark character (<literal>?</literal>) is expanded to the value of the first character in the key field for the entry in which it occurs. In the following example, the path is expanded to <filename>/home/jj/jane</filename>:</para><programlisting>jane /home/??/&amp;</programlisting>
</listitem>
</itemizedlist>
</sect4><sect4 id="wildcardrule"><title>Wildcard Rule</title><para>When supplied in the key field, the asterisk character (<literal>*</literal>) is recognized as the &ldquo;catch-all&rdquo; entry. Such an entry matches any key not previously matched.</para><para>For example, the following entry would map any user to a home directory in <filename>/home</filename> in which the home directory name was the same as the user name:</para><programlisting>*    /home/&amp;</programlisting><note><para>The wildcard rule is <emphasis>only</emphasis> applied if an appropriate rule is not matched by another map entry.</para>
</note>
</sect4><sect4 id="nsswitchmap"><title><filename>nsswitch</filename> Map</title><para>The <filename>nsswitch</filename> map is used to request that the home directory be obtained from a password database, such as the local, NIS, or LDAP database. If an AD path is appended, it is used to publish shares.</para><programlisting>+nsswitch</programlisting><para>Like the &ldquo;catch-all&rdquo; entry, the <literal>nsswitch</literal> map is <emphasis>only</emphasis> searched if an appropriate rule is not matched by another map entry.</para><note><para>The wildcard and <literal>nsswitch</literal> rules are mutually exclusive. Do not include an <literal>nsswitch</literal> rule if a wildcard rule has already been defined.</para>
</note>
</sect4>
</sect3>
</sect2>
</sect1><sect1 id="localsmbgroupsusers"><title>Local CIFS Groups</title><para>Local CIFS groups can be created on the system that runs the Solaris CIFS service. These CIFS groups apply only to users that are connected through CIFS.</para><itemizedlist><para>The Solaris CIFS service supports the following built-in CIFS groups:</para><listitem><para><emphasis role="strong">Administrators.</emphasis> Members of this group can fully administer files and directories on the system.</para>
</listitem><listitem><para><emphasis role="strong">Backup Operators.</emphasis> Members of this group can bypass file security to back up and restore files.</para>
</listitem><listitem><para><emphasis role="strong">Power Users.</emphasis> Members of this group can be assigned ownership of files and directories on the system, and can back up and restore files.</para>
</listitem>
</itemizedlist><para>Local groups use privileges to provide a secure mechanism for assigning task responsibility on a system-wide basis. Each privilege has a well-defined role assigned by the system administrator to a user or a group.</para><para>Unlike access rights (which are assigned as permissions on a per-object basis through security descriptors), privileges are independent of objects. Privileges bypass object-based access control lists to allow the holder of the privilege to perform the role assigned. For example, members of the Backup Operators group must be able to bypass normal security checks to back up and restore files they would normally not be able to access.</para><itemizedlist><para>The following definitions show the difference between an access right and a privilege:</para><listitem><para>An <emphasis>access right</emphasis> is explicitly granted or denied to a user or a group. Access rights are assigned as permissions in a discretionary access control list (DACL) on a per-object basis.</para>
</listitem><listitem><para>A <emphasis>privilege</emphasis> is a system-wide role that implicitly grants members of a group the ability to perform predefined operations. Privileges override or bypass object-level access rights.</para>
</listitem>
</itemizedlist><para>You can assign any of the privileges to any of the local groups. Because you can make any domain user a member of the local groups, you can assign these privileges to any domain user.</para><itemizedlist><para>The following privileges are supported for local groups:</para><listitem><para><emphasis role="strong">Back up files and directories.</emphasis> Perform backups without requiring read access permission on the target files and folders.</para>
</listitem><listitem><para><emphasis role="strong">Restore files and directories.</emphasis> Restore files without requiring write access permission on the target files and folders.</para>
</listitem><listitem><para><emphasis role="strong">Take ownership of files and folders.</emphasis> Take ownership of an object without requiring take-ownership access permission. Ownership can only be set to those values that the holder of the privilege may legitimately assign to an object.</para>
</listitem>
</itemizedlist><para>By default, members of the local Administrators group can take ownership of any file or folder, and members of the Backup Operators group can perform backup and restore operations. Members of the Power Users group do not have default privileges.</para><para>For information about managing CIFS groups, see <olink targetptr="managingsmbgroupsuserstm" remap="internal">Managing CIFS Groups (Task Map)</olink>.</para>
</sect1>
</chapter>