<chapter id="smbclienttasks"><title>Solaris CIFS Client Administration (Tasks)</title><highlights><para>This chapter provides instructions on how to use the Solaris CIFS client to access CIFS shares from a CIFS server in a Windows environment.</para><itemizedlist><para>This chapter covers the following topics:</para><listitem><para><olink targetptr="smbclientusertaskstm" remap="internal">Managing CIFS Mounts in Your Local Environment (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="smbclientadmintaskstm" remap="internal">Managing CIFS Mounts in the Global Environment (Task Map)</olink></para>
</listitem>
</itemizedlist><note><para>CIFS is an enhanced version of the SMB protocol, which allows CIFS clients to access files and resources on CIFS servers. The terms SMB and CIFS can be considered interchangeable.</para>
</note>
</highlights><sect1 id="smbclientusertaskstm"><title>Managing CIFS Mounts in Your Local Environment (Task Map)</title><para>The following table points to the tasks that a regular user can perform to manage CIFS mounts.</para><informaltable frame="all"><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>Find the shares that are available on a CIFS server in your domain.</para>
</entry><entry><para>From a particular CIFS server, view the shares that you can mount on a directory that you own.</para>
</entry><entry><para><olink targetptr="findsharestask" remap="internal">How to Find Available Shares on a Known File Server</olink></para>
</entry>
</row><row><entry><para>Mount a CIFS share on a directory that you own.</para>
</entry><entry><para>Use the <command>mount</command> command to mount the share on a mount point that you own.</para>
</entry><entry><para><olink targetptr="mountsharetask" remap="internal">How to Mount a Share on a Directory You Own</olink></para>
</entry>
</row><row><entry><para>View the list of CIFS shares that are mounted on the system.</para>
</entry><entry><para>View the list of mounted CIFS shares.</para>
</entry><entry><para><olink targetptr="viewmountedsharestask" remap="internal">How to View the List of Mounted CIFS Shares</olink></para>
</entry>
</row><row><entry><para>Unmount a CIFS share from a directory that you own.</para>
</entry><entry><para>When you no longer need access to a CIFS share, you can unmount it.</para>
</entry><entry><para><olink targetptr="unmountsharetask" remap="internal">How to Unmount a Share From a Directory You Own</olink></para>
</entry>
</row><row><entry><para>Store a persistent password to be used for authentication.</para>
</entry><entry><para>When you store a persistent password, you can bypass the manual authentication required each time that you want to mount a share from the specified server.</para>
</entry><entry><para><olink targetptr="storepasswordtask" remap="internal">How to Store a Persistent Password</olink></para>
</entry>
</row><row><entry><para>Use a PAM module to store a persistent password to be used for authentication.</para>
</entry><entry><para>Use this optional functionality only in environments that do not run Active Directory or Kerberos, but which synchronize passwords between Solaris clients and their CIFS/SMB servers.</para>
</entry><entry><para><olink targetptr="pammoduletask" remap="internal">How to Configure the PAM Module to Store a Persistent Password</olink></para>
</entry>
</row><row><entry><para>Delete a persistent password.</para>
</entry><entry><para>If you no longer want to store a persistent password, delete it.</para>
</entry><entry><para><olink targetptr="deletepasswordtask" remap="internal">How to Delete a Persistent Password</olink></para>
</entry>
</row><row><entry><para>Customize your environment by using a <filename>$HOME/.nsmbrc</filename> file.</para>
</entry><entry><para>You can customize your Solaris CIFS environment by specifying values for Solaris CIFS client properties.</para>
</entry><entry><para><olink targetptr="customizeenvtask" remap="internal">How to Customize Your Solaris CIFS Environment</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><task id="findsharestask"><title>How to Find Available Shares on a Known File Server</title><procedure><step><para>Determine the server that you want to query about available shares.</para><para>If you are not familiar with the CIFS file servers available in your domain, contact your system administrator. You might be able to use Network Neighborhood on Windows systems or the Sun <trademark>Java</trademark> Desktop System file browser to browse for available CIFS shares.</para>
</step><step><para>List the available CIFS shares on a server.</para><screen>$ <userinput>smbutil view [-A | -U <replaceable>user</replaceable>] //[<replaceable>domain</replaceable>;][<replaceable>user</replaceable>[:<replaceable>password</replaceable>]@]<replaceable>server</replaceable></userinput></screen><para><literal>//</literal>[<replaceable>domain</replaceable><literal>;</literal>][<replaceable>user</replaceable>[<literal>:</literal><replaceable>password</replaceable>]<literal>@</literal>]<replaceable>server</replaceable> is a resource name. <replaceable>user</replaceable> is the user name with which you connect to the CIFS server, <replaceable>server</replaceable>. You can optionally specify the domain name and the password of the user that you specified on the command line.</para><para>The <option>A</option> option enables you to view shares anonymously, and you are not prompted for a password. The <option>U</option> <replaceable>user</replaceable> option indicates the user with which to authenticate on the specified server.</para>
</step><step><para>When prompted, enter the password for the user that you specified on the CIFS server.</para><para>If you specified the <option>A</option> option to view shares anonymously, you are not prompted for a password.</para><para>If you did not specify a user, enter the password associated with your user name.</para>
</step><step><para>View the list of available CIFS shares.</para><para>The <command>smbutil view</command> output shows the name of the share, its type, and an optional text description of the share.</para><itemizedlist><para>Most shares have a type of <literal>disk</literal> because the shares are files and directories. The other share types are as follows:</para><listitem><para><literal>IPC</literal> <emphasis role="strong">&ndash;</emphasis> Represents an interprocess communication (IPC) device, such as a pipe or a mailslot</para>
</listitem><listitem><para><literal>printer</literal> <emphasis role="strong">&ndash;</emphasis> Represents a printer queue</para>
</listitem><listitem><para><literal>device</literal> <emphasis role="strong">&ndash;</emphasis> Represents a communications device</para>
</listitem>
</itemizedlist><para>For example, the following command shows how to view the shares on the <literal>solarsystem</literal> server:</para><screen>$ <userinput>smbutil view //cal@solarsystem</userinput>
Password:
Share        Type       Comment
-------------------------------
netlogon     disk       Network Logon Service
ipc$         IPC        IPC Service (Samba Server)
tmp          disk       Temporary file space
public       disk       Public Stuff
ethereal     disk
root         disk       Home Directories

6 shares listed from 6 available</screen><note><para>The Solaris CIFS client does not support <literal>device</literal> shares.</para>
</note><para>The following command enables you to anonymously view the shares on the <literal>solarsystem</literal> server:</para><screen>$ <userinput>smbutil view -A //solarsystem</userinput></screen>
</step>
</procedure>
</task><task id="mountsharetask"><title>How to Mount a Share on a Directory You Own</title><tasksummary><note><para>If you own the directory on which you want to mount a share, you can perform the mount operation yourself. If you do not own the directory, you must perform the mount operation as the owner of the directory or as superuser.</para>
</note>
</tasksummary><procedure><step><para>Find the share that you want to mount from a server.</para><screen>$ <userinput>smbutil view //<replaceable>server</replaceable></userinput></screen>
</step><step><para>Enter your password at the prompt.</para>
</step><step><para>Perform the mount on your directory.</para><screen>$ <userinput>mount -F smbfs //[<replaceable>workgroup</replaceable>;][<replaceable>user</replaceable>[:<replaceable>password</replaceable>]@]<replaceable>server</replaceable>/<replaceable>share</replaceable> <replaceable>mount-point</replaceable></userinput></screen><para>For example, to mount the <filename>/tmp</filename> share from the <literal>solarsystem</literal> server on the <filename>/mnt</filename> mount point, type:</para><screen>$ <userinput>mount -F smbfs //solarsystem/tmp /mnt</userinput></screen>
</step>
</procedure>
</task><task id="viewmountedsharestask"><title>How to View the List of Mounted CIFS Shares</title><tasksummary><para>This procedure shows how to list all of the CIFS shares that are mounted on your system. The resulting list includes your mounts, other users' mounts, and multiuser mounts created by the system administrator.</para>
</tasksummary><procedure remap="single-step"><step><para>List all CIFS mounts.</para><para>Use one of the following commands to list the mounted CIFS shares:</para><stepalternatives><step><para>Use the <command>mount</command> command.</para><screen>$ <userinput>mount -v | grep 'type smbfs'</userinput>
//root@solarsystem/tmp on /mnt type smbfs read/write/setuid/devices/dev=5080000
  on Tue Feb 12 11:40:18 2008
//root@solarsystem/files on /files type smbfs read/write/setuid/devices/dev=4800000
  on Mon Feb 11 22:17:56 2008</screen>
</step><step><para>Use the <command>df -k -F smbfs</command> command.</para><screen>$ <userinput>df -k -F smbfs</userinput>
//root@solarsystem/tmp      1871312   70864 1800448     4%    /mnt
//root@solarsystem/files    8067749    8017 7979055     1%    /files</screen>
</step>
</stepalternatives>
</step>
</procedure>
</task><task id="unmountsharetask"><title>How to Unmount a Share From a Directory You Own</title><tasksummary><para>To successfully unmount a share, you must own the mount point on which the share is mounted.</para>
</tasksummary><procedure><step><para>Determine the mount point of the share that you want to unmount.</para><para>Use one of the following commands to find shares that are mounted from a CIFS server:</para><stepalternatives><step><para>Use the <command>mount</command> command.</para><screen>$ <userinput>mount -v | grep 'type smbfs'</userinput>
//root@solarsystem/tmp on /mnt type smbfs read/write/setuid/devices/dev=5080000
  on Tue Feb 12 11:40:18 2008
//root@solarsystem/files on /files type smbfs read/write/setuid/devices/dev=4800000
  on Mon Feb 11 22:17:56 2008</screen>
</step><step><para>Use the <command>df -k -F smbfs</command> command.</para><screen>$ <userinput>df -k -F smbfs</userinput>
//root@solarsystem/tmp      1871312   70864 1800448     4%    /mnt
//root@solarsystem/files    8067749    8017 7979055     1%    /files</screen>
</step>
</stepalternatives>
</step><step><para>Unmount the share by specifying the name of the mount point, <filename>/mnt</filename> or <filename>/files</filename> in the previous step.</para><para>For example:</para><screen>$ <userinput>umount /mnt</userinput></screen>
</step>
</procedure>
</task><task id="storepasswordtask"><title>How to Store a Persistent Password</title><tasksummary><para>Interactions with a CIFS file server require authentication. For instance, when you view the shares available on a server or you try to mount a share on your system, the transaction is authenticated.</para><note><para>A persistent password is not needed when Kerberos is configured on the client and server and you have a Kerberos ticket-granting ticket (TGT). In such configurations, you can view and mount shares without specifying a password.</para>
</note><para>You can supply the password each time that you make a connection to the server, or you can store a <olink type="custom-text" targetptr="glossarypersistentpassword" remap="internal"><emphasis>persistent password</emphasis></olink> to be automatically used for these transactions.</para><note><para>You can store a persistent password for each user on the CIFS server that you use to access shares.</para>
</note><itemizedlist><para>The password you store persists until any of the following occur:</para><listitem><para>The CIFS client is rebooted.</para>
</listitem><listitem><para>The <command>smbutil logout</command> command is run for the user.</para>
</listitem><listitem><para>The <command>smbutil logoutall</command> command is run by superuser.</para>
</listitem>
</itemizedlist>
</tasksummary><procedure remap="single-step"><step><para>Store the persistent password for the CIFS server.</para><screen>$ <userinput>smbutil login <replaceable>user</replaceable></userinput>
Password:</screen><para>The following command stores the persistent password for <literal>terry@solarsystem</literal>. Each time Terry performs a transaction with <literal>solarsystem</literal>, the persistent password is used to perform the authentication.</para><screen>$ <userinput>smbutil login terry@solarsystem</userinput>
Password:</screen>
</step>
</procedure>
</task><task id="pammoduletask"><title>How to Configure the PAM Module to Store a Persistent Password</title><tasksummary><para>When installed, the <filename>pam_smbfs_login.so.1</filename> module enables you to store a persistent password the same as if you had run the <command>smbutil login</command> command for <literal>PAM_USER</literal> in the user's or system's default domain.</para><para>This optional functionality is meant to be used only in environments that do not run Active Directory or Kerberos, but which synchronize passwords between Solaris clients and their CIFS/SMB servers.</para><para>For more information, see the <olink targetdoc="refman5" targetptr="pam-smbfs-login-5" remap="external"><citerefentry><refentrytitle>pam_smbfs_login</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink> man page.</para>
</tasksummary><procedure><step><para>Use your login name and password to store a persistent password.</para><para>Add the following line to the <filename>/etc/pam.conf</filename> file after the other <literal>login</literal> entries:</para><screen>login   auth optional           pam_smbfs_login.so.1</screen><para>This action adds a persistent password entry as if you had run the <command>smbutil login</command> command.</para><note><para>The PAM module implements a privilege to permit it to run as superuser to store your password.</para>
</note>
</step><step><para>Verify that your persistent password is stored.</para><screen>$ <userinput>smbutil login -c <replaceable>user</replaceable></userinput></screen>
</step>
</procedure><example id="configuringpammodule"><title>Configuring the PAM Module to Store a Persistent Password</title><para>The following example shows how the domain is chosen. The system default is <literal>WORKGROUP</literal>. The <literal>WORKGROUP</literal> domain is overridden by any default from SMF, and finally by any default from the user's <filename>.nsmbrc</filename> file.</para><para>This example shows a default domain in SMF and for user <literal>terry</literal>:</para><screen># <userinput>sharectl set -p section=default -p domain=AAA smbfs</userinput>
# <userinput>sharectl get smbfs</userinput>
[default]
domain=AAA</screen><para>A <literal>root</literal> login uses the domain from SMF:</para><screen># <userinput>smbutil login -c terry</userinput>
Keychain entry exists for AAA/terry.</screen><para>A login as <literal>terry</literal> uses the domain from the <filename>~terry/.nsmbrc</filename> file:</para><screen>$ <userinput>ls /.nsmbrc</userinput>
/.nsmbrc: No such file or directory

$ <userinput>cat ~/.nsmbrc</userinput>
[default]
domain=MYDOMAIN
$ <userinput>ls -l ~/.nsmbrc</userinput>
-rw-r--r--   1 terry  staff         26 Feb 13 10:15 /home/terry/.nsmbrc
$ <userinput>smbutil login terry</userinput>
Keychain entry exists for MYDOMAIN/terry.</screen><para>If Terry puts a password in <filename>~terry/.nsmbrc</filename>, he must remove read permission. Also, because Terry's home directory is on an NFS server, the PAM module running as <literal>root</literal> cannot access Terry's file, so Terry would see the following and use the SMF domain instead:</para><screen>$ <userinput>chmod 400 .nsmbrc</userinput>
$ <userinput>logout</userinput>

solarsystem console login: <userinput>terry</userinput>
Password:
Can't open /home/terry/.nsmbrc: Permission denied
$ <userinput>su</userinput>
Password:
# <userinput>smbutil login -c terry</userinput>
Keychain entry exists for AAA/terry.</screen>
</example>
</task><task id="deletepasswordtask"><title>How to Delete a Persistent Password</title><tasksummary><para>Use this procedure to delete persistent passwords that are stored by the <command>smbutil login</command> command.</para><para>If you want to delete <emphasis>all</emphasis> persistent passwords, see <olink targetptr="deleteallpasswordstask" remap="internal">How to Delete All Persistent Passwords</olink>.</para>
</tasksummary><procedure remap="single-step"><step><para>Delete a persistent password for the specified server by doing one of the following:</para><stepalternatives><step><para>To delete the persistent password for a specified user, type:</para><screen>$ <userinput>smbutil logout <replaceable>user</replaceable>@<replaceable>server</replaceable></userinput></screen><para>For example, the following command removes the persistent password for <literal>terry@solarsystem</literal>:</para><screen>$ <userinput>smbutil logout terry@solarsystem</userinput></screen><para>After the password is deleted, Terry is prompted for his password each time that he performs a transaction with <literal>solarsystem</literal>.</para>
</step><step><para>To delete the password for the user running the <command>smbutil logout</command> command, type:</para><screen>$ <userinput>smbutil logout <replaceable>server</replaceable></userinput></screen><para>For example, when user <literal>dana</literal> runs the following command, he removes his persistent password for <literal>solarsystem</literal>:</para><screen>$ <userinput>smbutil logout solarsystem</userinput></screen><para>After the password is deleted, Dana is prompted for his password each time that he performs a transaction with <literal>solarsystem</literal>.</para>
</step>
</stepalternatives>
</step>
</procedure>
</task><task id="customizeenvtask"><title>How to Customize Your Solaris CIFS Environment</title><tasksummary><para>You can customize your Solaris CIFS environment by creating a <filename>.nsmbrc</filename> configuration file in your home directory. For more information about the <filename>.nsmbrc</filename> file format, see the <olink targetdoc="refman4" targetptr="nsmbrc-4" remap="external"><citerefentry><refentrytitle>nsmbrc</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</tasksummary><procedure><step><para>Create a file called <filename>.nsmbrc</filename> file in your home directory.</para>
</step><step><para>Edit the <filename>.nsmbrc</filename> file to specify values for Solaris CIFS client properties.</para><para>This example shows how user <literal>terry</literal> can configure the <literal>example.com</literal> environment by placing this <filename>.nsmbrc</filename> configuration file in his home directory.</para><para>The default section describes the default domain, which is called <literal>SALES</literal>, and sets a default user of <literal>MYUSER</literal>. These default settings are inherited by other sections unless property values are overridden.</para><para><literal>FSERVER</literal> is a server section that defines a server called <literal>fserv.example.com</literal>. It is part of the <literal>SALES</literal> domain.</para><para><literal>RSERVER</literal> is a server section that defines a server called <literal>rserv.example.com</literal> that belongs to a new domain called <literal>REMGROUP</literal>.</para><programlisting># Configuration file for example.com
# Specify the Windows account name to use everywhere.
[default]
domain=SALES
user=MYUSER

# The 'FSERVER' is server in our domain.
[FSERVER]
addr=fserv.example.com

# The 'RSERVER' is a server in another domain.
[RSERVER]
domain=REMGROUP
addr=rserv.example.com</programlisting>
</step>
</procedure>
</task>
</sect1><sect1 id="smbclientadmintaskstm"><title>Managing CIFS Mounts in the Global Environment (Task Map)</title><para>The following table points to the tasks that superuser can perform to manage CIFS mounts.</para><informaltable frame="all"><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>Mount a share on a public mount point, such as one in the root file system, so that many users can access the share.</para>
</entry><entry><para>Some shares include files and directories that many people on a system might want to access, such as a global set of files or programs. In such cases, instead of each user mounting the share in his own directory, the system administrator can mount the share in a public place so that all users can access the share from the same location.</para>
</entry><entry><para><olink targetptr="setupmultiusersharetask" remap="internal">How to Mount a Multiuser Share</olink></para>
</entry>
</row><row><entry><para>Customize the global environment by using the <command>sharectl</command> command to set Solaris CIFS properties.</para>
</entry><entry><para>User-specified properties override global properties with the exception of security settings.</para>
</entry><entry><para><olink targetptr="customizeglobalenvtask" remap="internal">How to Customize the Global Solaris CIFS Environment</olink></para>
</entry>
</row><row><entry><para>View the global Solaris CIFS property settings by using the <command>sharectl</command> command.</para>
</entry><entry><para>If one property is set with different values in each section, all values are shown.</para>
</entry><entry><para><olink targetptr="viewglobalenvtask" remap="internal">How to View the Global Solaris CIFS Environment Property Settings</olink></para>
</entry>
</row><row><entry><para>Add a CIFS share to an automounter map.</para>
</entry><entry><para>Use this procedure if you want a CIFS share to be automatically mounted at boot time.</para>
</entry><entry><para><olink targetptr="automountsharetask" remap="internal">How to Add a Direct Automounter Entry for a CIFS Share</olink></para>
</entry>
</row><row><entry><para>Delete all persistent passwords.</para>
</entry><entry><para>Use this procedure if you want to clear all persistent passwords.</para>
</entry><entry><para><olink targetptr="deleteallpasswordstask" remap="internal">How to Delete All Persistent Passwords</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><task id="setupmultiusersharetask"><title>How to Mount a Multiuser Share</title><tasksummary><para>If you want to make a share available to one or more users on a system, you can mount the share on a mount point anywhere on the system. When you mount a share as superuser, you do not need to own the mount point.</para>
</tasksummary><procedure>&rolestep;<step><para>Find the share that you want to mount from a server.</para><screen># <userinput>smbutil view //<replaceable>server</replaceable></userinput></screen>
</step><step><para>Specify the password at the prompt.</para>
</step><step><para>Determine the mount point that you want to use.</para><para>For example, you decide to mount shares on the <filename>/sales-tools</filename> mount point.</para>
</step><step><para>Perform the mount.</para><screen># <userinput>mount -F smbfs //[<replaceable>workgroup</replaceable>;][<replaceable>user</replaceable>[:<replaceable>password</replaceable>]@]<replaceable>server</replaceable>/<replaceable>share</replaceable> <replaceable>mount-point</replaceable></userinput></screen><para>For example, to mount the <filename>/tmp</filename> share from the <literal>solarsystem</literal> server on the <filename>/sales-tools</filename> mount point, type:</para><screen># <userinput>mount -F smbfs //solarsystem/tmp /sales-tools</userinput></screen>
</step>
</procedure>
</task><task id="customizeglobalenvtask"><title>How to Customize the Global Solaris CIFS Environment</title><tasksummary><para>You can customize the global Solaris CIFS environment by using the <citerefentry><refentrytitle>sharectl</refentrytitle><manvolnum>1M</manvolnum></citerefentry> command. With the exception of the <literal>minauth</literal> property, globally set properties can be overridden by a value set in user's <filename>.nsmbrc</filename> file. The most secure value of the <literal>minauth</literal> property takes precedence over a less secure value set by the user or set in the global environment.</para>
</tasksummary><procedure>&rolestepsmbfs;<step><para>Determine which properties you want to set.</para><para>For a description of the properties, see the <olink targetdoc="refman4" targetptr="nsmbrc-4" remap="external"><citerefentry><refentrytitle>nsmbrc</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</step><step><para>Set a property value for the global Solaris CIFS environment.</para><screen># <userinput>sharectl set [-h] [-p <replaceable>property</replaceable>=<replaceable>value</replaceable>] &hellip; smbfs</userinput></screen><para>For example, to specify a default workgroup name of <literal>SALES</literal> for the default section, type:</para><screen># <userinput>sharectl set -p section=default -p workgroup=SALES smbfs</userinput></screen>
</step>
</procedure>
</task><task id="viewglobalenvtask"><title>How to View the Global Solaris CIFS Environment Property Settings</title><tasksummary><para>You can view the global Solaris CIFS environment property settings by using the <citerefentry><refentrytitle>sharectl</refentrytitle><manvolnum>1M</manvolnum></citerefentry> command.</para><para>If you set a value for the same property in more than one section, the <command>sharectl get</command> output includes the section name, property name, and value.</para>
</tasksummary><procedure remap="single-step"><step><para>Determine which properties you want to view.</para><para>For a description of the properties, see the <olink targetdoc="refman4" targetptr="nsmbrc-4" remap="external"><citerefentry><refentrytitle>nsmbrc</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para><stepalternatives><step><para>To view the value for a specific property, type:</para><screen>$ <userinput>sharectl get [-p <replaceable>property</replaceable>] &hellip; smbfs</userinput></screen><para>For example, to view the values for the <literal>timeout</literal> property, type:</para><screen>$ <userinput>sharectl get -p timeout smbfs</userinput>
[SALES] timeout=5
[default] timeout=10</screen>
</step><step><para>To view all of the property settings, type:</para><screen>$ <userinput>sharectl get smbfs</userinput>
[SALES]
password=$$178465324253e0c07
timeout=5

[default]
timeout=10</screen>
</step>
</stepalternatives>
</step>
</procedure>
</task><task id="automountsharetask"><title>How to Add a Direct Automounter Entry for a CIFS Share</title><tasksummary><para>You can add a CIFS share <filename>/etc/auto_direct</filename> file so that the share will be automatically mounted when a user accesses the mount point. See <olink targetptr="storepasswordtask" remap="internal">How to Store a Persistent Password</olink>.</para><para>To successfully use the automount feature, you must store a persistent password for authentication to mount the share.</para>
</tasksummary><procedure>&rolestep;<step><para>Edit the <filename>/etc/auto_direct</filename> file to add the mapping.</para><para>The following examples show the changes to the <filename>/etc/auto_direct</filename> file to configure automount maps.</para><itemizedlist><listitem><para>To configure an automount of the <filename>//solarsystem/public</filename> share on the <filename>/PUBLIC</filename> mount point, create the following entry in the <filename>/etc/auto_direct</filename> file:</para><programlisting>/PUBLIC -fstype=smbfs //solarsystem/public</programlisting>
</listitem><listitem><para>To configure an automount of a share and to specify the password to be used for authentication, create the following entry in the <filename>/etc/auto_direct</filename> file:</para><programlisting>/PUBLIC -fstype=smbfs //guest:guest@solarsystem/public</programlisting><para>This entry specifies that all access to the <filename>//solarsystem/public</filename> share is done as the user <literal>guest</literal> and uses the specified password, which in this example is <literal>guest</literal>.</para>
</listitem><listitem><para>To configure an automount of a share that can be accessed anonymously, which does not require a password, specify the <literal>noprompt</literal> option:</para><programlisting>/PUBLIC -noprompt,fstype=smbfs //solarsystem/public</programlisting>
</listitem>
</itemizedlist><para>When a user accesses the <filename>/PUBLIC</filename> directory, such as by using the <command>ls</command> or <command>cd</command> command, the share is automounted.</para><screen>$ <userinput>ls /PUBLIC</userinput>
bin docs</screen><para>After the CIFS share is mounted, a user can use regular Solaris commands to access the files. Automounted shares are automatically unmounted after a period of inactivity.</para>
</step>
</procedure>
</task><task id="deleteallpasswordstask"><title>How to Delete All Persistent Passwords</title><tasksummary><para>Use this procedure to delete all of the persistent passwords that are used to authenticate CIFS transactions.</para><para>If you only want to delete the persistent passwords for a particular user, see <olink targetptr="deletepasswordtask" remap="internal">How to Delete a Persistent Password</olink>.</para>
</tasksummary><procedure>&rolestep;<step><para>Delete all of the persistent passwords.</para><screen># <userinput>smbutil logoutall</userinput></screen><para>After the persistent passwords are deleted, each time a user performs a transaction with a CIFS server, he is prompted for his password.</para>
</step>
</procedure>
</task>
</sect1>
</chapter>