File Formats nsmbrc(4) NAME .nsmbrc - configuration file for SMB requests SYNOPSIS $HOME/.nsmbrc DESCRIPTION Global behavior of the SMB client is defined by parameter values that are stored in the Service Management Facility (SMF). The .nsmbrc file can be used to customize the behavior of the SMB client on a per-user basis. Settings in the $HOME/.nsmbrc file are used unless they have security implications. A privileged user can use the sharectl command to set global values for these parameters in SMF. See the sharectl(1M) man page. The SMB library first reads from SMF and then the $HOME/.nsmbrc file when determining which policy to apply to a particular server, user, or share. $HOME/.nsmbrc entries take precedence with the exception of the minauth parameter value. For minauth, the strongest authentication level specified is used. Sections are applied so that more specific sections override less specific sections. Note that not all keywords are valid in all sections. The configuration file is comprised of these four section types. Each section can include zero or more parameters and associated values. The sections also are part of a hierarch- ical relationship with each other, which is shown by the order of the following list: o Default section. Specifies the default parameter values to be used by all other sections unless specifically overridden. The section name appears in the .nsmbrc file as [default]. o Server section. Specifies the parameter values to be used by sections that are related to the named server. These parameter values can be specifically overridden by a related user section or share sec- tion. The section name appears in the .nsmbrc file as [server-name]. o User section. Specifies the parameter values to be used by sections that are related to the named SunOS 5.11 Last change: May 15, 2007 1 File Formats nsmbrc(4) server and user. These parameter values can be specifically overridden by a related share section. The section name appears in the .nsmbrc as [server-name:user-name]. o Share section. Specifies the parameter values to be used by sections that are related to the named server, user, and share. The section name appears in the .nsmbrc as [server-name:user-name:share-name]. The end of each section is marked either by the start of a new section or by an end of file (EOF). The following list describes the parameters and describes in which sections they can be set: addr Specify the DNS name or IP address of the SMB server. This parameter can only be set in a server section. If this parameter is specified, it must specify a value as there is no default. charsets Specify the local:remote character set pair. This param- eter can only be set in the server, user, and share sec- tions. The default value is empty, charsets="", which means that no character-mapping action is taken. minauth Minimum authentication level required, which can be one of kerberos, ntlmv2, ntlm, lm, or none. If minauth is set globally and in a user's .nsmbrc file, the stronger authentication setting will be used whether set by the user or globally. This parameter can only be set in the default and server sections. The default value is ntlm. nbns Specify the DNS name or IP address of NetBIOS/WINS name server. This parameter can only be set by an administra- tor by using the sharectl command. The default value is empty, nbns="". SunOS 5.11 Last change: May 15, 2007 2 File Formats nsmbrc(4) nbscope Specify the NetBIOS scope (for NBT VLANs). This parame- ter can only be set by an administrator by using the sharectl command. The default value is empty, nbscope="". nbtimeout Specify the NetBIOS name service request timeout. By default, the timeout is 1 second. This parameter can only be set in the default and server sections. retry_count Specify the number of SMB retries to attempt before the connection is marked as broken. By default, 4 attempts are made. This parameter can only be set in the default and server sections. timeout Specify the SMB request timeout. By default, the timeout is 15 seconds. This parameter can only be set in the default, server, and share sections. use_negprot_domain Specify whether to disable domain negotiation. The "NO" value disables domain negotiation. This parameter can only be set in the default and server sections. workgroup Specify the workgroup name. This parameter can be set in all sections. If this parameter is specified, it must specify the value as there is no default. EXAMPLES The following examples show how to use the .nsmbrc file and the smbutil command to configure the ex.com environment. The ex.com environment is described by means of these sec- tions and settings: o The default section describes the default workgroup (domain), which is called SALES, and sets a timeout of 5 seconds. These default settings are inherited by other sections unless parameter values are SunOS 5.11 Last change: May 15, 2007 3 File Formats nsmbrc(4) overridden. o FSERVER is a server section that defines a server called fserv.ex.com. It is part of the SALES work- group and has a timeout of 5 seconds. o RSERVER is a server section that defines a server called rserv.ex.com that belongs to a new workgroup called REMGROUP. o RSERVER:george is a server-user section that speci- fies that a special character set, koi8-r:cp866, be used for the george user. This section is related to the RSERVER section, so it is part of the REM- GROUP workgroup instead of the default workgroup, SALES. o SSERV:*:POKY is a server-user-share section that applies to all SSERV users who use the POKY share. This section sets a longer timeout of 25 seconds because the POKY share is known to be slow. SSERV is part of the SALES workgroup. Example 1 Using the $HOME/.nsmbrc Configuration File This example shows how a user can configure the ex.com environment by creating the .nsmbrc file. All lines that begin with the # character are comments and are not parsed. # Configuration file for ex.com [default] workgroup=SALES timeout=5 # The 'FSERVER' is server in our workgroup. [FSERVER] addr=fserv.ex.com # The 'RSERVER' is a server in another workgroup. [RSERVER] workgroup=REMGROUP addr=rserv.ex.com # On 'RSERVER', only user george needs special charset mapping. [RSERVER:george] charsets=koi8-r:cp866 # The 'SSERVER' is a server whose 'POKY' share is known to be slow. SunOS 5.11 Last change: May 15, 2007 4 File Formats nsmbrc(4) [SSERV:*:POKY] timeout=25 Example 2 Using the sharectl Command This example shows how a privileged user can use sharectl commands to configure global settings for the ex.com environment in SMF: # sharectl set -p section=default -p workgroup=SALES \ -p timeout=5 smb/client # sharectl set -p section=FSERVER -p addr=fserv.ex.com smb/client # sharectl set -p section=RSERVER -p workgroup=REMGROUP \ -p addr=rserv.ex.com smb/client # sharectl set -p section=RSERVER:george -p charsets=koi8-r:cp866 \ smb/client # sharectl set -p section="SSERV:*:POKY" -p addr=sserv.ex.com \ -p timeout=25 smb/client Example 3 Using the sharectl Command to Show Current Set- tings This example shows how a privileged user can use sharectl get command to view the global settings for smb/client in SMF. The values shown are those set by the previous example: # sharectl get smb/client [default] workgroup=SALES timeout=5 [FSERVER] addr=fserv.ex.com [RSERVER] workgroup=REMGROUP addr=rserv.ex.com [RSERVER:george] charsets=koi8-r:cp866 [SSERV:*:POKY] addr=sserv.ex.com timeout=25 FILES $HOME/.nsmbrc User-settable mount point configuration file to store the description for each connection. SunOS 5.11 Last change: May 15, 2007 5 File Formats nsmbrc(4) ATTRIBUTES See the attributes(5) man page for descriptions of the fol- lowing attributes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWsmbfscu | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| SEE ALSO smbutil(1), mount_smbfs(1M), sharectl(1M) NOTES On BSD systems, the $HOME/.nsmbrc file can be used to store an encrypted password for a share. This functionality is not supported by the Solaris Operating System. SunOS 5.11 Last change: May 15, 2007 6