1.\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $
2.\" $FreeBSD$
3.Dd November 1, 2018
4.Dt MOUNT_SMBFS 8
5.Os
6.Sh NAME
7.Nm mount_smbfs
8.Nd "mount a shared resource from an SMB file server"
9.Sh SYNOPSIS
10.Nm
11.Op Fl E Ar cs1 Ns Cm \&: Ns Ar cs2
12.Op Fl I Ar host
13.Op Fl L Ar locale
14.Op Fl M Ar crights Ns Cm \&: Ns Ar srights
15.Op Fl N
16.Op Fl O Ar cowner Ns Cm \&: Ns Ar cgroup Ns Cm \&/ Ns Ar sowner Ns Cm \&: Ns Ar sgroup
17.Op Fl R Ar retrycount
18.Op Fl T Ar timeout
19.Op Fl U Ar username
20.Op Fl W Ar workgroup
21.Op Fl c Ar case
22.Op Fl d Ar mode
23.Op Fl f Ar mode
24.Op Fl g Ar gid
25.Op Fl n Ar opt
26.Op Fl u Ar uid
27.Sm off
28.Cm \&// Ns Ar user Cm \&@ Ar server
29.Op Cm \&: Ar port1 Op Cm \&: Ar port2
30.Cm \&/ Ar share
31.Sm on
32.Ar node
33.Sh DESCRIPTION
34The
35.Nm
36command mounts a share from a remote server using SMB/CIFS protocol.
37.Pp
38The options are as follows:
39.Bl -tag -width indent
40.It Fl E Ar cs1 Ns Cm \&: Ns Ar cs2
41Specifies local
42.Pq Ar cs1
43and server's
44.Pq Ar cs2
45character sets.
46.It Fl I Ar host
47Do not use NetBIOS name resolver and connect directly to
48.Ar host ,
49which can be either a valid DNS name or an IP address.
50.It Fl L Ar locale
51Use
52.Ar locale
53for lower/upper case conversion routines.
54Set the locale for case conversion.
55By default,
56.Nm
57tries to use an environment variable
58.Ev LC_*
59to determine it.
60.It Fl M Ar crights Ns Cm \&: Ns Ar srights
61Assign access rights to the newly created connection.
62.It Fl N
63Do not ask for a password.
64At run time,
65.Nm
66reads the
67.Pa ~/.nsmbrc
68file for additional configuration parameters and a password.
69If no password is found,
70.Nm
71prompts for it.
72.It Fl O Ar cowner Ns Cm \&: Ns Ar cgroup Ns Cm \&/ Ns Ar sowner Ns Cm \&: Ns Ar sgroup
73Assign owner/group attributes to the newly created connection.
74.It Fl R Ar retrycount
75How many retries should be done before the SMB requester decides to drop
76the connection.
77Default is 4.
78.It Fl T Ar timeout
79Timeout in seconds for each request.
80Default is 15.
81.It Fl U Ar username
82Username to authenticate with.
83.It Fl W Ar workgroup
84This option specifies the workgroup to be used in the authentication request.
85.It Fl c Ar case
86Set a
87.Ar case
88option which affects name representation.
89.Ar case
90can be one of the following:
91.Bl -tag -width ".Em Value"
92.It Em Value
93.Em Meaning
94.It Cm l
95All existing file names are converted to lower case.
96Newly created file gets a lower case.
97.It Cm u
98All existing file names are converted to upper case.
99Newly created file gets an upper case.
100.El
101.It Fl f Ar mode , Fl d Ar mode
102Specify permissions that should be assigned to files and directories.
103The values must be specified as octal numbers.
104Default value for the file mode
105is taken from mount point, default value for the directory mode adds execute
106permission where the file mode gives read permission.
107.Pp
108Note that these permissions can differ from the rights granted by SMB
109server.
110.It Fl u Ar uid , Fl g Ar gid
111User ID and group ID assigned to files.
112The default are owner and group IDs from
113the directory where the volume is mounted.
114.It Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Oo Cm \&: Ns Ar port1 Ns Oo Cm \&: Ns Ar port2 Oc Oc Ns Cm \&/ Ns Ar share
115The
116.Nm
117command will use
118.Ar server
119as the NetBIOS name of remote computer,
120.Ar user
121as the remote user name and
122.Ar share
123as the resource name on a remote server.
124Optional
125.Ar port1
126and
127.Ar port2
128arguments can be used to override default values of port numbers used
129by communication protocols.
130For SMB over NetBIOS default value for
131.Ar port1
132are 139, and
133.Ar port2
134are 137.
135.It Ar node
136Path to mount point.
137.El
138.Sh FILES
139.Bl -tag -width ".Pa /etc/nsmb.conf" -compact
140.It Pa ~/.nsmbrc
141Keeps user-specific static parameters for connections and other information.
142See
143.Pa /usr/share/examples/smbfs/dot.nsmbrc
144for details.
145.It Pa /etc/nsmb.conf
146Keeps system-wide static parameters for connections and other information.
147.El
148.Sh EXAMPLES
149The following example illustrates how to connect to SMB server
150.Dq SAMBA
151as user
152.Dq GUEST ,
153and mount shares
154.Dq PUBLIC
155and
156.Dq TMP :
157.Bd -literal -offset indent
158mount_smbfs -I samba.mydomain.com //guest@samba/public /smb/public
159mount_smbfs -I 192.168.20.3 -E koi8-r:cp866 //guest@samba/tmp /smb/tmp
160.Ed
161.Pp
162It is also possible to use
163.Xr fstab 5
164for smbfs mounts (the example below does not prompt for a password):
165.Pp
166.Dl "//guest@samba/public    /smb/public     smbfs  rw,noauto,-N 0   0"
167.Sh SEE ALSO
168.Xr smbutil 1 ,
169.Xr nsmb.conf 5
170.Pp
171Other resources:
172.Bl -dash -compact
173.It
174Chapter dedicated to Samba configuration in the
175.Fx
176Handbook:
177.Lk "https://www.freebsd.org/doc/handbook/network-samba.html"
178.El
179.Sh STANDARDS
180.Nm
181offers support for SMB/CIFS/SMB1.
182It does not support newer versions of the protocol like SMB2 and SMB3.
183SMB2 and SMB3 are supported by software available in the
184.Xr ports 7
185collection.
186.Pp
187The list of supported SMB servers includes:
188.Bl -dash -compact
189.It
190Samba
191.It
192Windows 95/98/ME/2000/NT4.0 (SPs 4, 5, 6)
193.It
194IBM LanManager
195.It
196NetApp
197.El
198.Sh HISTORY
199SMB/CIFS protocol and SMB/CIFS file system implementation first appeared in
200.Fx 4.5 .
201.Sh AUTHORS
202.An Boris Popov Aq bp@butya.kz ,
203.Aq bp@FreeBSD.org
204.Sh BUGS
205Please report bugs to the author.
206