1MOUNT.CIFS, MOUNT.SMB3(8) MOUNT.CIFS, MOUNT.SMB3(8)
2
3
4
6 mount.cifs, mount.smb3 - mount using the Common Internet File System
7 (CIFS)
8
10 mount.cifs {service} {mount-point} [-o options]
11
12 This tool is part of the cifs-utils suite.
13
14 mount.cifs mounts a CIFS or SMB3 filesystem from Linux. It is usually
15 invoked indirectly by the mount(8) command when using the "-t cifs" op‐
16 tion. This command only works in Linux, and the kernel must support the
17 cifs filesystem. The SMB3 protocol is the successor to the CIFS (SMB)
18 protocol and is supported by most Windows servers, Azure (cloud stor‐
19 age), Macs and many other commercial servers and Network Attached Stor‐
20 age appliances as well as by the popular Open Source server Samba.
21
22 mount.smb3 mounts only SMB3 filesystem. It is usually invoked indi‐
23 rectly by the mount(8) command when using the "-t smb3" option. The
24 smb3 filesystem type was added in kernel-4.18 and above. It works in a
25 similar fashion as mount.cifs except it passes filesystem type as smb3.
26
27 The mount.cifs utility attaches the UNC name (exported network re‐
28 source) specified as service (using //server/share syntax, where
29 "server" is the server name or IP address and "share" is the name of
30 the share) to the local directory mount-point.
31
32 Options to mount.cifs are specified as a comma-separated list of
33 key=value pairs. It is possible to send options other than those listed
34 here, assuming that the cifs filesystem kernel module (cifs.ko) sup‐
35 ports them. Unrecognized cifs mount options passed to the cifs vfs ker‐
36 nel code will be logged to the kernel log.
37
38 mount.cifs causes the cifs vfs to launch a thread named cifsd. After
39 mounting it keeps running until the mounted resource is unmounted (usu‐
40 ally via the umount utility).
41
42 mount.cifs -V command displays the version of cifs mount helper.
43
44 modinfo cifs command displays the version of cifs module.
45
47 username=arg|user=arg
48 specifies the username to connect as. If this is not given, then
49 the environment variable USER is used.
50
51 Earlier versions of mount.cifs also allowed one to specify the
52 username in a user%password or workgroup/user or work‐
53 group/user%password to allow the password and workgroup to be
54 specified as part of the username. Support for those alternate
55 username formats is now deprecated and should no longer be used.
56 Users should use the discrete password= and domain= to specify
57 those values. While some versions of the cifs kernel module ac‐
58 cept user= as an abbreviation for this option, its use can con‐
59 fuse the standard mount program into thinking that this is a
60 non-superuser mount. It is therefore recommended to use the full
61 username= option name.
62
63 password=arg|pass=arg
64 specifies the CIFS password. If this option is not given then
65 the environment variable PASSWD is used. If the password is not
66 specified directly or indirectly via an argument to mount,
67 mount.cifs will prompt for a password, unless the guest option
68 is specified.
69
70 Note that a password which contains the delimiter character
71 (i.e. a comma ',') will fail to be parsed correctly on the com‐
72 mand line. However, the same password defined in the PASSWD en‐
73 vironment variable or via a credentials file (see below) or en‐
74 tered at the password prompt will be read correctly.
75
76 credentials=filename|cred=filename
77 specifies a file that contains a username and/or password and
78 optionally the name of the workgroup. The format of the file is:
79
80 username=value
81 password=value
82 domain=value
83
84 This is preferred over having passwords in plaintext in a shared
85 file, such as /etc/fstab . Be sure to protect any credentials
86 file properly.
87
88 uid=arg
89 sets the uid that will own all files or directories on the
90 mounted filesystem when the server does not provide ownership
91 information. It may be specified as either a username or a nu‐
92 meric uid. When not specified, the default is uid 0. The
93 mount.cifs helper must be at version 1.10 or higher to support
94 specifying the uid in non-numeric form. See the section on FILE
95 AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more informa‐
96 tion.
97
98 forceuid
99 instructs the client to ignore any uid provided by the server
100 for files and directories and to always assign the owner to be
101 the value of the uid= option. See the section on FILE AND DIREC‐
102 TORY OWNERSHIP AND PERMISSIONS below for more information.
103
104 cruid=arg
105 sets the uid of the owner of the credentials cache. This is pri‐
106 marily useful with sec=krb5. The default is the real uid of the
107 process performing the mount. Setting this parameter directs the
108 upcall to look for a credentials cache owned by that user.
109
110 gid=arg
111 sets the gid that will own all files or directories on the
112 mounted filesystem when the server does not provide ownership
113 information. It may be specified as either a groupname or a nu‐
114 meric gid. When not specified, the default is gid 0. The
115 mount.cifs helper must be at version 1.10 or higher to support
116 specifying the gid in non-numeric form. See the section on FILE
117 AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more informa‐
118 tion.
119
120 forcegid
121 instructs the client to ignore any gid provided by the server
122 for files and directories and to always assign the owner to be
123 the value of the gid= option. See the section on FILE AND DIREC‐
124 TORY OWNERSHIP AND PERMISSIONS below for more information.
125
126 idsfromsid
127 Extract uid/gid from special SID instead of mapping it. See the
128 section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below
129 for more information.
130
131 port=arg
132 sets the port number on which the client will attempt to contact
133 the CIFS server. If this value is specified, look for an exist‐
134 ing connection with this port, and use that if one exists. If
135 one doesn't exist, try to create a new connection on that port.
136 If that connection fails, return an error. If this value isn't
137 specified, look for an existing connection on port 445 or 139.
138 If no such connection exists, try to connect on port 445 first
139 and then port 139 if that fails. Return an error if both fail.
140
141 netbiosname=arg
142 When mounting to servers via port 139, specifies the RFC1001
143 source name to use to represent the client netbios machine dur‐
144 ing the netbios session initialization.
145
146 servern=arg
147 Similar to netbiosname except it specifies the netbios name of
148 the server instead of the client. Although rarely needed for
149 mounting to newer servers, this option is needed for mounting to
150 some older servers (such as OS/2 or Windows 98 and Windows ME)
151 since when connecting over port 139 they, unlike most newer
152 servers, do not support a default server name. A server name can
153 be up to 15 characters long and is usually uppercased.
154
155 file_mode=arg
156 If the server does not support the CIFS Unix extensions this
157 overrides the default file mode.
158
159 dir_mode=arg
160 If the server does not support the CIFS Unix extensions this
161 overrides the default mode for directories.
162
163 ip=arg|addr=arg
164 sets the destination IP address. This option is set automati‐
165 cally if the server name portion of the requested UNC name can
166 be resolved so rarely needs to be specified by the user.
167
168 domain=arg|dom=arg|workgroup=arg
169 Sets the domain (workgroup) of the user. If no domains are
170 given, the empty domain will be used. Use domainauto to automat‐
171 ically guess the domain of the server you are connecting to.
172
173 domainauto
174 When using NTLM authentication and not providing a domain via
175 domain, guess the domain from the server NTLM challenge. This
176 behavior used to be the default on kernels older than 2.6.36.
177
178 guest don't prompt for a password.
179
180 iocharset
181 Charset used to convert local path names to and from Unicode.
182 Unicode is used by default for network path names if the server
183 supports it. If iocharset is not specified then the nls_default
184 specified during the local client kernel build will be used. If
185 server does not support Unicode, this parameter is unused.
186
187 ro mount read-only.
188
189 rw mount read-write.
190
191 setuids
192 If the CIFS Unix extensions are negotiated with the server the
193 client will attempt to set the effective uid and gid of the lo‐
194 cal process on newly created files, directories, and devices
195 (create, mkdir, mknod). If the CIFS Unix Extensions are not ne‐
196 gotiated, for newly created files and directories instead of us‐
197 ing the default uid and gid specified on the the mount, cache
198 the new file's uid and gid locally which means that the uid for
199 the file can change when the inode is reloaded (or the user re‐
200 mounts the share).
201
202 nosetuids
203 The client will not attempt to set the uid and gid on on newly
204 created files, directories, and devices (create, mkdir, mknod)
205 which will result in the server setting the uid and gid to the
206 default (usually the server uid of the user who mounted the
207 share). Letting the server (rather than the client) set the uid
208 and gid is the default. If the CIFS Unix Extensions are not ne‐
209 gotiated then the uid and gid for new files will appear to be
210 the uid (gid) of the mounter or the uid (gid) parameter speci‐
211 fied on the mount.
212
213 perm Client does permission checks (vfs_permission check of uid and
214 gid of the file against the mode and desired operation), Note
215 that this is in addition to the normal ACL check on the target
216 machine done by the server software. Client permission checking
217 is enabled by default.
218
219 noperm Client does not do permission checks. This can expose files on
220 this mount to access by other users on the local client system.
221 It is typically only needed when the server supports the CIFS
222 Unix Extensions but the UIDs/GIDs on the client and server sys‐
223 tem do not match closely enough to allow access by the user do‐
224 ing the mount. Note that this does not affect the normal ACL
225 check on the target machine done by the server software (of the
226 server ACL against the user name provided at mount time).
227
228 dynperm
229 Instructs the server to maintain ownership and permissions in
230 memory that can't be stored on the server. This information can
231 disappear at any time (whenever the inode is flushed from the
232 cache), so while this may help make some applications work, it's
233 behavior is somewhat unreliable. See the section below on FILE
234 AND DIRECTORY OWNERSHIP AND PERMISSIONS for more information.
235
236 cache=arg
237 Cache mode. See the section below on CACHE COHERENCY for de‐
238 tails. Allowed values are:
239
240 • none - do not cache file data at all
241
242 • strict - follow the CIFS/SMB2 protocol strictly
243
244 • loose - allow loose caching semantics
245
246 The default in kernels prior to 3.7 was loose. As of kernel 3.7
247 the default is strict.
248
249 nostrictsync
250 Do not ask the server to flush on fsync(). Some servers perform
251 non-buffered writes by default in which case flushing is redun‐
252 dant. In workloads where a client is performing a lot of small
253 write + fsync combinations and where network latency is much
254 higher than the server latency, this brings a 2x performance im‐
255 provement. This option is also a good candidate in scenarios
256 where we want performance over consistency.
257
258 handlecache
259 (default) In SMB2 and above, the client often has to open the
260 root of the share (empty path) in various places during mount,
261 path revalidation and the statfs(2) system call. This option
262 cuts redundant round trip traffic (opens and closes) by simply
263 keeping the directory handle for the root around once opened.
264
265 nohandlecache
266 Disable caching of the share root directory handle.
267
268 handletimeout=arg
269 The time (in milliseconds) for which the server should reserve
270 the handle after a failover waiting for the client to reconnect.
271 When mounting with resilienthandles or persistenthandles mount
272 option, or when their use is requested by the server (continuous
273 availability shares) then this parameter overrides the server
274 default handle timeout (which for most servers is 120 seconds).
275
276 rwpidforward
277 Forward pid of a process who opened a file to any read or write
278 operation on that file. This prevent applications like wine(1)
279 from failing on read and write if we use mandatory brlock style.
280
281 mapchars
282 Translate six of the seven reserved characters (not backslash,
283 but including the colon, question mark, pipe, asterik, greater
284 than and less than characters) to the remap range (above
285 0xF000), which also allows the CIFS client to recognize files
286 created with such characters by Windows's Services for Mac. This
287 can also be useful when mounting to most versions of Samba
288 (which also forbids creating and opening files whose names con‐
289 tain any of these seven characters). This has no effect if the
290 server does not support Unicode on the wire. Please note that
291 the files created with mapchars mount option may not be accessi‐
292 ble if the share is mounted without that option.
293
294 nomapchars
295 (default) Do not translate any of these seven characters.
296
297 mapposix
298 Translate reserved characters similarly to mapchars but use the
299 mapping from Microsoft "Services For Unix".
300
301 intr currently unimplemented.
302
303 nointr (default) currently unimplemented.
304
305 hard The program accessing a file on the cifs mounted file system
306 will hang when the server crashes.
307
308 soft (default) The program accessing a file on the cifs mounted file
309 system will not hang when the server crashes and will return er‐
310 rors to the user application.
311
312 noacl Do not allow POSIX ACL operations even if server would support
313 them.
314
315 The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to
316 Samba servers version 3.0.10 and later. Setting POSIX ACLs re‐
317 quires enabling both CIFS_XATTR and then CIFS_POSIX support in
318 the CIFS configuration options when building the cifs module.
319 POSIX ACL support can be disabled on a per mount basis by speci‐
320 fying noacl on mount.
321
322 cifsacl
323 This option is used to map CIFS/NTFS ACLs to/from Linux permis‐
324 sion bits, map SIDs to/from UIDs and GIDs, and get and set Secu‐
325 rity Descriptors.
326
327 See section on CIFS/NTFS ACL, SID/UID/GID MAPPING, SECURITY DE‐
328 SCRIPTORS for more information.
329
330 backupuid=arg
331 File access by this user shall be done with the backup intent
332 flag set. Either a name or an id must be provided as an argu‐
333 ment, there are no default values.
334
335 See section ACCESSING FILES WITH BACKUP INTENT for more details.
336
337 backupgid=arg
338 File access by users who are members of this group shall be done
339 with the backup intent flag set. Either a name or an id must be
340 provided as an argument, there are no default values.
341
342 See section ACCESSING FILES WITH BACKUP INTENT for more details.
343
344 nocase Request case insensitive path name matching (case sensitive is
345 the default if the server supports it).
346
347 ignorecase
348 Synonym for nocase.
349
350 sec=arg
351 Security mode. Allowed values are:
352
353 • none - attempt to connection as a null user (no name)
354
355 • krb5 - Use Kerberos version 5 authentication
356
357 • krb5i - Use Kerberos authentication and forcibly enable packet
358 signing
359
360 • ntlm - Use NTLM password hashing
361
362 • ntlmi - Use NTLM password hashing and force packet signing
363
364 • ntlmv2 - Use NTLMv2 password hashing
365
366 • ntlmv2i - Use NTLMv2 password hashing and force packet signing
367
368 • ntlmssp - Use NTLMv2 password hashing encapsulated in Raw
369 NTLMSSP message
370
371 • ntlmsspi - Use NTLMv2 password hashing encapsulated in Raw
372 NTLMSSP message, and force packet signing
373
374 The default in mainline kernel versions prior to v3.8 was
375 sec=ntlm. In v3.8, the default was changed to sec=ntlmssp.
376
377 If the server requires signing during protocol negotiation, then
378 it may be enabled automatically. Packet signing may also be en‐
379 abled automatically if it's enabled in /proc/fs/cifs/Securi‐
380 tyFlags.
381
382 seal Request encryption at the SMB layer. The encryption algorithm
383 used is AES-128-CCM. Requires SMB3 or above (see vers).
384
385 rdma Connect directly to the server using SMB Direct via a RDMA
386 adapter. Requires SMB3 or above (see vers).
387
388 resilienthandles
389 Enable resilient handles. If the server supports it, keep opened
390 files across reconnections. Requires SMB2.1 (see vers).
391
392 noresilienthandles
393 (default) Disable resilient handles.
394
395 persistenthandles
396 Enable persistent handles. If the server supports it, keep
397 opened files across reconnections. Persistent handles are also
398 valid across servers in a cluster and have stronger guarantees
399 than resilient handles. Requires SMB3 or above (see vers).
400
401 nopersistenthandles
402 (default) Disable persistent handles.
403
404 snapshot=time
405 Mount a specific snapshot of the remote share. time must be a
406 positive integer identifying the snapshot requested (in
407 100-nanosecond units that have elapsed since January 1, 1601, or
408 alternatively it can be specified in GMT format e.g.
409 @GMT-2019.03.27-20.52.19). Supported in the Linux kernel start‐
410 ing from v4.19.
411
412 nobrl Do not send byte range lock requests to the server. This is nec‐
413 essary for certain applications that break with cifs style
414 mandatory byte range locks (and most cifs servers do not yet
415 support requesting advisory byte range locks).
416
417 forcemandatorylock
418 Do not use POSIX locks even when available via unix extensions.
419 Always use cifs style mandatory locks.
420
421 locallease
422 Check cached leases locally instead of querying the server.
423
424 nolease
425 Do not request lease/oplock when openning a file on the server.
426 This turns off local caching of IO, byte-range lock and read
427 metadata operations (see actimeo for more details about metadata
428 caching). Requires SMB2 and above (see vers).
429
430 sfu When the CIFS or SMB3 Unix Extensions are not negotiated, at‐
431 tempt to create device files and fifos in a format compatible
432 with Services for Unix (SFU). In addition retrieve bits 10-12 of
433 the mode via the SETFILEBITS extended attribute (as SFU does).
434 In the future the bottom 9 bits of the mode mode also will be
435 emulated using queries of the security descriptor (ACL). [NB:
436 requires version 1.39 or later of the CIFS VFS. To recognize
437 symlinks and be able to create symlinks in an SFU interoperable
438 form requires version 1.40 or later of the CIFS VFS kernel mod‐
439 ule.
440
441 mfsymlinks
442 Enable support for Minshall+French symlinks (see
443 http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks).
444 This option is ignored when specified together with the sfu op‐
445 tion. Minshall+French symlinks are used even if the server sup‐
446 ports the CIFS Unix Extensions.
447
448 echo_interval=n
449 sets the interval at which echo requests are sent to the server
450 on an idling connection. This setting also affects the time re‐
451 quired for a connection to an unresponsive server to timeout.
452 Here n is the echo interval in seconds. The reconnection happens
453 at twice the value of the echo_interval set for an unresponsive
454 server. If this option is not given then the default value of
455 60 seconds is used. The minimum tunable value is 1 second and
456 maximum can go up to 600 seconds.
457
458 serverino
459 Use inode numbers (unique persistent file identifiers) returned
460 by the server instead of automatically generating temporary in‐
461 ode numbers on the client. Although server inode numbers make it
462 easier to spot hardlinked files (as they will have the same in‐
463 ode numbers) and inode numbers may be persistent (which is use‐
464 ful for some software), the server does not guarantee that the
465 inode numbers are unique if multiple server side mounts are ex‐
466 ported under a single share (since inode numbers on the servers
467 might not be unique if multiple filesystems are mounted under
468 the same shared higher level directory). Note that not all
469 servers support returning server inode numbers, although those
470 that support the CIFS Unix Extensions, and Windows 2000 and
471 later servers typically do support this (although not necessar‐
472 ily on every local server filesystem). Parameter has no effect
473 if the server lacks support for returning inode numbers or
474 equivalent. This behavior is enabled by default.
475
476 noserverino
477 Client generates inode numbers itself rather than using the ac‐
478 tual ones from the server.
479
480 See section INODE NUMBERS for more information.
481
482 posix|unix|linux
483 (default) Enable Unix Extensions for this mount. Requires CIFS
484 (vers=1.0) or SMB3.1.1 (vers=3.1.1) and a server supporting
485 them.
486
487 noposix|nounix|nolinux
488 Disable the Unix Extensions for this mount. This can be useful
489 in order to turn off multiple settings at once. This includes
490 POSIX acls, POSIX locks, POSIX paths, symlink support and re‐
491 trieving uids/gids/mode from the server. This can also be useful
492 to work around a bug in a server that supports Unix Extensions.
493
494 See section INODE NUMBERS for more information.
495
496 nouser_xattr
497 Do not allow getfattr/setfattr to get/set xattrs, even if server
498 would support it otherwise. The default is for xattr support to
499 be enabled.
500
501 nodfs Do not follow Distributed FileSystem referrals. IO on a file not
502 stored on the server will fail instead of connecting to the tar‐
503 get server transparently.
504
505 noautotune
506 Use fixed size for kernel recv/send socket buffers.
507
508 nosharesock
509 Do not try to reuse sockets if the system is already connected
510 to the server via an existing mount point. This will make the
511 client always make a new connection to the server no matter what
512 he is already connected to. This can be useful in simulating
513 multiple clients connecting to the same server, as each mount
514 point will use a different TCP socket.
515
516 noblocksend
517 Send data on the socket using non blocking operations (MSG_DONT‐
518 WAIT flag).
519
520 rsize=bytes
521 Maximum amount of data that the kernel will request in a read
522 request in bytes. Maximum size that servers will accept is typi‐
523 cally 8MB for SMB3 or later dialects. Default requested during
524 mount is 4MB. Prior to the 4.20 kernel the default requested was
525 1MB. Prior to the SMB2.1 dialect the maximum was usually 64K.
526
527 wsize=bytes
528 Maximum amount of data that the kernel will send in a write re‐
529 quest in bytes. Maximum size that servers will accept is typi‐
530 cally 8MB for SMB3 or later dialects. Default requested during
531 mount is 4MB. Prior to the 4.20 kernel the default requested was
532 1MB. Prior to the SMB2.1 dialect the maximum was usually 64K.
533
534 bsize=bytes
535 Override the default blocksize (1MB) reported on SMB3 files (re‐
536 quires kernel version of 5.1 or later). Prior to kernel version
537 5.1, the blocksize was always reported as 16K instead of 1MB
538 (and was not configurable) which can hurt the performance of
539 tools like cp and scp (especially for uncached I/O) which decide
540 on the read and write size to use for file copies based on the
541 inode blocksize. bsize may not be less than 16K or greater than
542 16M.
543
544 max_credits=n
545 Maximum credits the SMB2 client can have. Default is 32000. Must
546 be set to a number between 20 and 60000.
547
548 fsc Enable local disk caching using FS-Cache for CIFS. This option
549 could be useful to improve performance on a slow link, heavily
550 loaded server and/or network where reading from the disk is
551 faster than reading from the server (over the network). This
552 could also impact the scalability positively as the number of
553 calls to the server are reduced. But, be warned that local
554 caching is not suitable for all workloads, for e.g., read-once
555 type workloads. So, you need to consider carefully the situa‐
556 tion/workload before using this option. Currently, local disk
557 caching is enabled for CIFS files opened as read-only.
558
559 NOTE: This feature is available only in the recent kernels that
560 have been built with the kernel config option CONFIG_CIFS_FS‐
561 CACHE. You also need to have cachefilesd daemon installed and
562 running to make the cache operational.
563
564 multiuser
565 Map user accesses to individual credentials when accessing the
566 server. By default, CIFS mounts only use a single set of user
567 credentials (the mount credentials) when accessing a share. With
568 this option, the client instead creates a new session with the
569 server using the user's credentials whenever a new user accesses
570 the mount. Further accesses by that user will also use those
571 credentials. Because the kernel cannot prompt for passwords,
572 multiuser mounts are limited to mounts using sec= options that
573 don't require passwords.
574
575 With this change, it's feasible for the server to handle permis‐
576 sions enforcement, so this option also implies noperm . Further‐
577 more, when unix extensions aren't in use and the administrator
578 has not overridden ownership using the uid= or gid= options,
579 ownership of files is presented as the current user accessing
580 the share.
581
582 actimeo=arg
583 The time (in seconds) that the CIFS client caches attributes of
584 a file or directory before it requests attribute information
585 from a server. During this period the changes that occur on the
586 server remain undetected until the client checks the server
587 again.
588
589 By default, the attribute cache timeout is set to 1 second. This
590 means more frequent on-the-wire calls to the server to check
591 whether attributes have changed which could impact performance.
592 With this option users can make a tradeoff between performance
593 and cache metadata correctness, depending on workload needs.
594 Shorter timeouts mean better cache coherency, but frequent in‐
595 creased number of calls to the server. Longer timeouts mean a
596 reduced number of calls to the server but looser cache co‐
597 herency. The actimeo value is a positive integer that can hold
598 values between 0 and a maximum value of 2^30 * HZ (frequency of
599 timer interrupt) setting.
600
601 noposixpaths
602 If unix extensions are enabled on a share, then the client will
603 typically allow filenames to include any character besides '/'
604 in a pathname component, and will use forward slashes as a path‐
605 name delimiter. This option prevents the client from attempting
606 to negotiate the use of posix-style pathnames to the server.
607
608 posixpaths
609 Inverse of noposixpaths .
610
611 vers=arg
612 SMB protocol version. Allowed values are:
613
614 • 1.0 - The classic CIFS/SMBv1 protocol.
615
616 • 2.0 - The SMBv2.002 protocol. This was initially introduced in
617 Windows Vista Service Pack 1, and Windows Server 2008. Note
618 that the initial release version of Windows Vista spoke a
619 slightly different dialect (2.000) that is not supported.
620
621 • 2.1 - The SMBv2.1 protocol that was introduced in Microsoft
622 Windows 7 and Windows Server 2008R2.
623
624 • 3.0 - The SMBv3.0 protocol that was introduced in Microsoft
625 Windows 8 and Windows Server 2012.
626
627 • 3.02 or 3.0.2 - The SMBv3.0.2 protocol that was introduced in
628 Microsoft Windows 8.1 and Windows Server 2012R2.
629
630 • 3.1.1 or 3.11 - The SMBv3.1.1 protocol that was introduced in
631 Microsoft Windows 10 and Windows Server 2016.
632
633 • 3 - The SMBv3.0 protocol version and above.
634
635 • default - Tries to negotiate the highest SMB2+ version sup‐
636 ported by both the client and server.
637
638 If no dialect is specified on mount vers=default is used. To
639 check Dialect refer to /proc/fs/cifs/DebugData
640
641 Note too that while this option governs the protocol version
642 used, not all features of each version are available.
643
644 The default since v4.13.5 is for the client and server to nego‐
645 tiate the highest possible version greater than or equal to 2.1.
646 In kernels prior to v4.13, the default was 1.0. For kernels be‐
647 tween v4.13 and v4.13.5 the default is 3.0.
648
649 --verbose
650 Print additional debugging information for the mount. Note that
651 this parameter must be specified before the -o . For example:
652
653 mount -t cifs //server/share /mnt --verbose -o user=username
654
656 It's generally preferred to use forward slashes (/) as a delimiter in
657 service names. They are considered to be the "universal delimiter"
658 since they are generally not allowed to be embedded within path compo‐
659 nents on Windows machines and the client can convert them to back‐
660 slashes (\) unconditionally. Conversely, backslash characters are al‐
661 lowed by POSIX to be part of a path component, and can't be automati‐
662 cally converted in the same way.
663
664 mount.cifs will attempt to convert backslashes to forward slashes where
665 it's able to do so, but it cannot do so in any path component following
666 the sharename.
667
669 When Unix Extensions are enabled, we use the actual inode number pro‐
670 vided by the server in response to the POSIX calls as an inode number.
671
672 When Unix Extensions are disabled and serverino mount option is enabled
673 there is no way to get the server inode number. The client typically
674 maps the server-assigned UniqueID onto an inode number.
675
676 Note that the UniqueID is a different value from the server inode num‐
677 ber. The UniqueID value is unique over the scope of the entire server
678 and is often greater than 2 power 32. This value often makes programs
679 that are not compiled with LFS (Large File Support), to trigger a glibc
680 EOVERFLOW error as this won't fit in the target structure field. It is
681 strongly recommended to compile your programs with LFS support (i.e.
682 with -D_FILE_OFFSET_BITS=64) to prevent this problem. You can also use
683 noserverino mount option to generate inode numbers smaller than 2 power
684 32 on the client. But you may not be able to detect hardlinks properly.
685
687 With a network filesystem such as CIFS or NFS, the client must contend
688 with the fact that activity on other clients or the server could change
689 the contents or attributes of a file without the client being aware of
690 it. One way to deal with such a problem is to mandate that all file ac‐
691 cesses go to the server directly. This is performance prohibitive how‐
692 ever, so most protocols have some mechanism to allow the client to
693 cache data locally.
694
695 The CIFS protocol mandates (in effect) that the client should not cache
696 file data unless it holds an opportunistic lock (aka oplock) or a
697 lease. Both of these entities allow the client to guarantee certain
698 types of exclusive access to a file so that it can access its contents
699 without needing to continually interact with the server. The server
700 will call back the client when it needs to revoke either of them and
701 allow the client a certain amount of time to flush any cached data.
702
703 The cifs client uses the kernel's pagecache to cache file data. Any I/O
704 that's done through the pagecache is generally page-aligned. This can
705 be problematic when combined with byte-range locks as Windows' locking
706 is mandatory and can block reads and writes from occurring.
707
708 cache=none means that the client never utilizes the cache for normal
709 reads and writes. It always accesses the server directly to satisfy a
710 read or write request.
711
712 cache=strict means that the client will attempt to follow the CIFS/SMB2
713 protocol strictly. That is, the cache is only trusted when the client
714 holds an oplock. When the client does not hold an oplock, then the
715 client bypasses the cache and accesses the server directly to satisfy a
716 read or write request. By doing this, the client avoids problems with
717 byte range locks. Additionally, byte range locks are cached on the
718 client when it holds an oplock and are "pushed" to the server when that
719 oplock is recalled.
720
721 cache=loose allows the client to use looser protocol semantics which
722 can sometimes provide better performance at the expense of cache co‐
723 herency. File access always involves the pagecache. When an oplock or
724 lease is not held, then the client will attempt to flush the cache soon
725 after a write to a file. Note that that flush does not necessarily oc‐
726 cur before a write system call returns.
727
728 In the case of a read without holding an oplock, the client will at‐
729 tempt to periodically check the attributes of the file in order to as‐
730 certain whether it has changed and the cache might no longer be valid.
731 This mechanism is much like the one that NFSv2/3 use for cache co‐
732 herency, but it particularly problematic with CIFS. Windows is quite
733 "lazy" with respect to updating the LastWriteTime field that the client
734 uses to verify this. The effect is that cache=loose can cause data cor‐
735 ruption when multiple readers and writers are working on the same
736 files.
737
738 Because of this, when multiple clients are accessing the same set of
739 files, then cache=strict is recommended. That helps eliminate problems
740 with cache coherency by following the CIFS/SMB2 protocols more
741 strictly.
742
743 Note too that no matter what caching model is used, the client will al‐
744 ways use the pagecache to handle mmap'ed files. Writes to mmap'ed files
745 are only guaranteed to be flushed to the server when msync() is called,
746 or on close().
747
748 The default in kernels prior to 3.7 was loose. As of 3.7, the default
749 is strict.
750
752 This option is used to work with file objects which posses Security De‐
753 scriptors and CIFS/NTFS ACL instead of UID, GID, file permission bits,
754 and POSIX ACL as user authentication model. This is the most common au‐
755 thentication model for CIFS servers and is the one used by Windows.
756
757 Support for this requires both CIFS_XATTR and CIFS_ACL support in the
758 CIFS configuration options when building the cifs module.
759
760 A CIFS/NTFS ACL is mapped to file permission bits using an algorithm
761 specified in the following Microsoft TechNet document:
762
763 http://technet.microsoft.com/en-us/library/bb463216.aspx
764
765 In order to map SIDs to/from UIDs and GIDs, the following is required:
766
767 • a kernel upcall to the cifs.idmap utility set up via re‐
768 quest-key.conf(5)
769
770 • winbind support configured via nsswitch.conf(5) and smb.conf(5)
771
772 Please refer to the respective manpages of cifs.idmap(8) and win‐
773 bindd(8) for more information.
774
775 Security descriptors for a file object can be retrieved and set di‐
776 rectly using extended attribute named system.cifs_acl. The security de‐
777 scriptors presented via this interface are "raw" blobs of data and need
778 a userspace utility to either parse and format or to assemble it such
779 as getcifsacl(1) and setcifsacl(1) respectively.
780
781 Some of the things to consider while using this mount option:
782
783 • There may be an increased latency when handling metadata due to addi‐
784 tional requests to get and set security descriptors.
785
786 • The mapping between a CIFS/NTFS ACL and POSIX file permission bits is
787 imperfect and some ACL information may be lost in the translation.
788
789 • If either upcall to cifs.idmap is not setup correctly or winbind is
790 not configured and running, ID mapping will fail. In that case uid
791 and gid will default to either to those values of the share or to the
792 values of uid and/or gid mount options if specified.
793
795 For an user on the server, desired access to a file is determined by
796 the permissions and rights associated with that file. This is typically
797 accomplished using ownership and ACL. For a user who does not have ac‐
798 cess rights to a file, it is still possible to access that file for a
799 specific or a targeted purpose by granting special rights. One of the
800 specific purposes is to access a file with the intent to either backup
801 or restore i.e. backup intent. The right to access a file with the
802 backup intent can typically be granted by making that user a part of
803 the built-in group Backup Operators. Thus, when this user attempts to
804 open a file with the backup intent, open request is sent by setting the
805 bit FILE_OPEN_FOR_BACKUP_INTENT as one of the CreateOptions.
806
807 As an example, on a Windows server, a user named testuser, cannot open
808 this file with such a security descriptor:
809
810 REVISION:0x1
811 CONTROL:0x9404
812 OWNER:Administrator
813 GROUP:Domain Users
814 ACL:Administrator:ALLOWED/0x0/FULL
815
816 But the user testuser, if it becomes part of the Backup Operators
817 group, can open the file with the backup intent.
818
819 Any user on the client side who can authenticate as such a user on the
820 server, can access the files with the backup intent. But it is desir‐
821 able and preferable for security reasons amongst many, to restrict this
822 special right.
823
824 The mount option backupuid is used to restrict this special right to a
825 user which is specified by either a name or an id. The mount option
826 backupgid is used to restrict this special right to the users in a
827 group which is specified by either a name or an id. Only users matching
828 either backupuid or backupgid shall attempt to access files with backup
829 intent. These two mount options can be used together.
830
832 The core CIFS protocol does not provide unix ownership information or
833 mode for files and directories. Because of this, files and directories
834 will generally appear to be owned by whatever values the uid= or gid=
835 options are set, and will have permissions set to the default file_mode
836 and dir_mode for the mount. Attempting to change these values via
837 chmod/chown will return success but have no effect.
838
839 When the client and server negotiate unix extensions, files and direc‐
840 tories will be assigned the uid, gid, and mode provided by the server.
841 Because CIFS mounts are generally single-user, and the same credentials
842 are used no matter what user accesses the mount, newly created files
843 and directories will generally be given ownership corresponding to
844 whatever credentials were used to mount the share.
845
846 If the uid's and gid's being used do not match on the client and
847 server, the forceuid and forcegid options may be helpful. Note however,
848 that there is no corresponding option to override the mode. Permissions
849 assigned to a file when forceuid or forcegid are in effect may not re‐
850 flect the the real permissions.
851
852 When unix extensions are not negotiated, it's also possible to emulate
853 them locally on the server using the dynperm mount option. When this
854 mount option is in effect, newly created files and directories will re‐
855 ceive what appear to be proper permissions. These permissions are not
856 stored on the server however and can disappear at any time in the fu‐
857 ture (subject to the whims of the kernel flushing out the inode cache).
858 In general, this mount option is discouraged.
859
860 It's also possible to override permission checking on the client alto‐
861 gether via the noperm option. Server-side permission checks cannot be
862 overridden. The permission checks done by the server will always corre‐
863 spond to the credentials used to mount the share, and not necessarily
864 to the user who is accessing the share.
865
867 The variable USER may contain the username of the person to be used to
868 authenticate to the server. The variable can be used to set both user‐
869 name and password by using the format username%password.
870
871 The variable PASSWD may contain the password of the person using the
872 client.
873
874 The variable PASSWD_FILE may contain the pathname of a file to read the
875 password from. A single line of input is read and used as the password.
876
878 This command may be used only by root, unless installed setuid, in
879 which case the noexec and nosuid mount flags are enabled. When in‐
880 stalled as a setuid program, the program follows the conventions set
881 forth by the mount program for user mounts, with the added restriction
882 that users must be able to chdir() into the mountpoint prior to the
883 mount in order to be able to mount onto it.
884
885 Some samba client tools like smbclient(8) honour client-side configura‐
886 tion parameters present in smb.conf. Unlike those client tools,
887 mount.cifs ignores smb.conf completely.
888
890 The primary mechanism for making configuration changes and for reading
891 debug information for the cifs vfs is via the Linux /proc filesystem.
892 In the directory /proc/fs/cifs are various configuration files and
893 pseudo files which can display debug information and performance sta‐
894 tistics. There are additional startup options such as maximum buffer
895 size and number of buffers which only may be set when the kernel cifs
896 vfs (cifs.ko module) is loaded. These can be seen by running the mod‐
897 info utility against the file cifs.ko which will list the options that
898 may be passed to cifs during module installation (device driver load).
899 For more information see the kernel file fs/cifs/README. When configur‐
900 ing dynamic tracing (trace-cmd) note that the list of SMB3 events which
901 can be enabled can be seen at: /sys/kernel/debug/tracing/events/cifs/.
902
904 The use of SMB2.1 or later (including the latest dialect SMB3.1.1) is
905 recommended for improved security and SMB1 is no longer requested by
906 default at mount time. Old dialects such as CIFS (SMB1, ie vers=1.0)
907 have much weaker security. Use of CIFS (SMB1) can be disabled by mod‐
908 probe cifs disable_legacy_dialects=y.
909
911 Mounting using the CIFS URL specification is currently not supported.
912
913 The credentials file does not handle usernames or passwords with lead‐
914 ing space.
915
916 Note that the typical response to a bug report is a suggestion to try
917 the latest version first. So please try doing that first, and always
918 include which versions you use of relevant software when reporting bugs
919 (minimum: mount.cifs (try mount.cifs -V), kernel (see /proc/version)
920 and server type you are trying to contact.
921
923 This man page is correct for version 2.18 of the cifs vfs filesystem
924 (roughly Linux kernel 5.0).
925
927 cifs.upcall(8), getcifsacl(1), setcifsacl(1)
928
929 Documentation/filesystems/cifs.txt and fs/cifs/README in the Linux ker‐
930 nel source tree may contain additional options and information.
931
933 Steve French
934
935 The maintainer of the Linux cifs vfs is Steve French. The maintainer of
936 the cifs-utils suite of user space tools is Pavel Shilovsky. The Linux
937 CIFS Mailing list is the preferred place to ask questions regarding
938 these programs.
939
940
941
942
943 MOUNT.CIFS, MOUNT.SMB3(8)