1.\"- 2.\" SPDX-License-Identifier: BSD-2-Clause 3.\" 4.\" Copyright (c) 2003 5.\" Originally written by Sergey A. Osokin 6.\" Rewritten by Tom Rhodes 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" 29.Dd November 2, 2018 30.Dt NSMB.CONF 5 31.Os 32.Sh NAME 33.Nm nsmb.conf 34.Nd configuration file for server message block (SMB1/CIFS) requests 35.Sh DESCRIPTION 36The 37.Nm 38file contains information about the computers, users, and shares 39or mount points for the 40.Tn SMB 41network protocol. 42.Pp 43The configuration files are loaded in the following order: 44.Pp 45.Bl -enum -offset indent -width "" -compact 46.It 47.Pa ~/.nsmbrc 48.It 49.Pa /etc/nsmb.conf 50.El 51.Pp 52As a result, 53.Pa /etc/nsmb.conf 54settings 55override those in 56.Pa ~/.nsmbrc . 57.Pp 58The configuration hierarchy is made up of several sections, 59each section containing a few or several lines of parameters 60and their assigned values. 61Each of these sections must begin with a section name enclosed within 62square brackets, similar to: 63.Pp 64.D1 Bq Ar section_name 65.Pp 66The end of each section is marked by either the start of a new section, 67or by the abrupt ending of the file, commonly referred to as the 68.Tn EOF . 69Each section may contain zero or more parameters such as: 70.Pp 71.D1 Bq Ar section_name 72.D1 Ar key Ns = Ns Ar value 73.Pp 74where 75.Ar key 76represents a parameter name, and 77.Ar value 78would be the parameter's assigned value. 79.Pp 80The 81.Tn SMB 82library uses the following information for section names: 83.Pp 84.Bl -tag -width indent -compact 85.It Ic A) 86.Bq Li default 87.It Ic B) 88.Bq Ar SERVER 89.It Ic C) 90.Bq Ar SERVER : Ns Ar USER 91.It Ic D) 92.Op Ar SERVER : Ns Ar USER : Ns Ar SHARE 93.El 94.Pp 95Possible keywords may include: 96.Bl -column ".Va retry_count" ".Sy Section" 97.It Sy "Keyword Section Comment" 98.It Sy " A B C D" 99.It Va addr Ta "- + - -" Ta "IP address of SMB server" 100.It Va charsets Ta "- + + +" Ta "local:remote charset pair" 101.It Va nbns Ta "+ + - -" Ta "address of NetBIOS name server (WINS)" 102.It Va nbscope Ta "+ + - -" Ta "NetBIOS scope" 103.It Va nbtimeout Ta "+ + - -" Ta "timeout for NetBIOS name servers" 104.It Va password Ta "- - + +" Ta "plain text or simple encrypted password used to access the given share" 105.It Va retry_count Ta "+ + - -" Ta "number of retries before connection is marked as broken" 106.It Va timeout Ta "+ + - -" Ta "SMB request timeout" 107.It Va workgroup Ta "+ + + +" Ta "workgroup name" 108.El 109.Sh FILES 110.Bl -tag -width ".Pa /etc/nsmb.conf" 111.It Pa /etc/nsmb.conf 112The default remote mount-point configuration file. 113.It Pa ~/.nsmbrc 114The user specific remote mount-point configuration file. 115.El 116.Sh EXAMPLES 117What follows is a sample configuration file which may, 118or may not match your environment: 119.Bd -literal -offset indent 120# Configuration file for example.com 121[default] 122workgroup=SALES 123# The 'FSERVER' is an NT server. 124[FSERVER] 125charsets=koi8-r:cp866 126addr=fserv.example.com 127# User specific data for FSERVER 128[FSERVER:MYUSER] 129password=$$16144562c293a0314e6e1 130.Ed 131.Pp 132All lines which begin with the 133.Ql # 134character are comments and will not be parsed. 135The 136.Dq Li default 137section describes the default workgroup or domain, in this case 138.Dq Li SALES . 139The next section depicted here as 140.Dq Li FSERVER , 141defines a server section and then assigns it a charset which is only 142required when Cyrillic characters are not used. 143The hostname value, 144.Dq Li fserv.example.com , 145is also assigned in this section. 146.Dq Li FSERVER:USER , 147defines the user settings and is useful for saving the password used 148during a specific connection. 149The password may be plaintext or obfuscated using simple encryption. 150The simple encrypted password starts with the `$$1' symbols. 151Warning: the encryption function is very weak and intended only to hide 152clear text passwords. 153If the use of simple encryption is desired, the following command may be 154used on a password: 155.Bd -literal -offset indent 156smbutil crypt 157.Ed 158.Sh SEE ALSO 159.Xr smbutil 1 , 160.Xr mount_smbfs 8 161.Sh AUTHORS 162This manual page was written by 163.An -nosplit 164.An Sergey Osokin Aq Mt osa@FreeBSD.org 165and 166.An Tom Rhodes Aq Mt trhodes@FreeBSD.org . 167