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