1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="mount.cifs.8">
6 <refentrytitle>mount.cifs</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">3.6</refmiscinfo>
15 <refname>mount.cifs</refname>
16 <refpurpose>mount using the Common Internet File System (CIFS)</refpurpose>
22 <command>mount.cifs</command>
23 <arg choice="req">service</arg>
24 <arg choice="req">mount-point</arg>
25 <arg choice="opt">-o options</arg>
30 <title>DESCRIPTION</title>
32 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
33 <manvolnum>7</manvolnum></citerefentry> suite.</para>
35 <para>mount.cifs mounts a Linux CIFS filesystem. It
36 is usually invoked indirectly by
37 the <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> command when using the
38 "-t cifs" option. This command only works in Linux, and the kernel must
39 support the cifs filesystem. The CIFS protocol is the successor to the
40 SMB protocol and is supported by most Windows servers and many other
41 commercial servers and Network Attached Storage appliances as well as
42 by the popular Open Source server Samba.
46 The mount.cifs utility attaches the UNC name (exported network resource)
47 specified as <emphasis>service</emphasis> (using //server/share syntax,
48 where "server" is the server name or IP address and "share" is the name
49 of the share) to the local directory <emphasis>mount-point</emphasis>.
53 Options to <emphasis>mount.cifs</emphasis> are specified as a comma-separated
54 list of key=value pairs. It is possible to send options other
55 than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them.
56 Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the
61 <para><emphasis>mount.cifs</emphasis> causes the cifs vfs to launch a thread named cifsd. After mounting it keeps running until
62 the mounted resource is unmounted (usually via the umount utility).
66 <emphasis>mount.cifs -V</emphasis> command displays the version of cifs mount helper.
70 <emphasis>modinfo cifs</emphasis> command displays the version of cifs module.
76 <title>OPTIONS</title>
78 <varlistentry><term>user=<replaceable>arg</replaceable></term>
80 <listitem><para>specifies the username to connect as. If
81 this is not given, then the environment variable <emphasis>USER</emphasis> is used. This option can also take the
82 form "user%password" or "workgroup/user" or
83 "workgroup/user%password" to allow the password and workgroup
84 to be specified as part of the username.
89 The cifs vfs accepts the parameter <parameter>user=</parameter>, or for users familiar with smbfs it accepts the longer form of the parameter <parameter>username=</parameter>. Similarly the longer smbfs style parameter names may be accepted as synonyms for the shorter cifs parameters <parameter>pass=</parameter>,<parameter>dom=</parameter> and <parameter>cred=</parameter>.
96 <varlistentry><term>password=<replaceable>arg</replaceable></term>
98 <listitem><para>specifies the CIFS password. If this
99 option is not given then the environment variable
100 <emphasis>PASSWD</emphasis> is used. If the password is not specified
101 directly or indirectly via an argument to mount, <emphasis>mount.cifs</emphasis> will prompt
102 for a password, unless the guest option is specified.
105 <para>Note that a password which contains the delimiter
106 character (i.e. a comma ',') will fail to be parsed correctly
107 on the command line. However, the same password defined
108 in the PASSWD environment variable or via a credentials file (see
109 below) or entered at the password prompt will be read correctly.
111 </listitem></varlistentry>
113 <varlistentry><term>credentials=<replaceable>filename</replaceable></term>
116 specifies a file that contains a username
117 and/or password and optionally the name of the
118 workgroup. The format of the file is:
122 username=<replaceable>value</replaceable>
123 password=<replaceable>value</replaceable>
124 workgroup=<replaceable>value</replaceable>
128 This is preferred over having passwords in plaintext in a
129 shared file, such as <filename>/etc/fstab</filename>. Be sure to protect any
130 credentials file properly.
132 </listitem></varlistentry>
135 <term>uid=<replaceable>arg</replaceable></term>
138 <para>sets the uid that will own all files or directories on the
139 mounted filesystem when the server does not provide ownership
140 information. It may be specified as either a username or a numeric uid.
141 When not specified, the default is uid 0. The mount.cifs helper must be
142 at version 1.10 or higher to support specifying the uid in non-numeric
143 form. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more
150 <term>forceuid</term>
152 <para>instructs the client to ignore any uid provided by
153 the server for files and directories and to always assign the owner to
154 be the value of the uid= option. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.</para>
159 <term>gid=<replaceable>arg</replaceable></term>
162 <para>sets the gid that will own all files or
163 directories on the mounted filesystem when the server does not provide
164 ownership information. It may be specified as either a groupname or a
165 numeric gid. When not specified, the default is gid 0. The mount.cifs
166 helper must be at version 1.10 or higher to support specifying the gid
167 in non-numeric form. See the section on FILE AND DIRECTORY OWNERSHIP AND
168 PERMISSIONS below for more information.</para>
174 <term>forcegid</term>
176 <para>instructs the client to ignore any gid provided by
177 the server for files and directories and to always assign the owner to
178 be the value of the gid= option. See the section on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS below for more information.</para>
183 <term>port=<replaceable>arg</replaceable></term>
185 <listitem><para>sets the port number on the server to attempt to contact to negotiate
186 CIFS support. If the CIFS server is not listening on this port or
187 if it is not specified, the default ports will be tried i.e.
188 port 445 is tried and if no response then port 139 is tried.
193 <term>servern=<replaceable>arg</replaceable></term>
196 Specify the server netbios name (RFC1001 name) to use
197 when attempting to setup a session to the server. Although
198 rarely needed for mounting to newer servers, this option
199 is needed for mounting to some older servers (such
200 as OS/2 or Windows 98 and Windows ME) since when connecting
201 over port 139 they, unlike most newer servers, do not
202 support a default server name. A server name can be up
203 to 15 characters long and is usually uppercased.
208 <term>netbiosname=<replaceable>arg</replaceable></term>
210 <listitem><para>When mounting to servers via port 139, specifies the RFC1001
211 source name to use to represent the client netbios machine
212 name when doing the RFC1001 netbios session initialize.
217 <term>file_mode=<replaceable>arg</replaceable></term>
219 <listitem><para>If the server does not support the CIFS Unix extensions this
220 overrides the default file mode.</para></listitem>
224 <term>dir_mode=<replaceable>arg</replaceable></term>
226 <listitem><para>If the server does not support the CIFS Unix extensions this
227 overrides the default mode for directories. </para></listitem>
231 <term>ip=<replaceable>arg</replaceable></term>
233 <listitem><para>sets the destination IP address. This option is set automatically if the server name portion of the requested UNC name can be resolved so rarely needs to be specified by the user.</para></listitem>
237 <term>domain=<replaceable>arg</replaceable></term>
239 <listitem><para>sets the domain (workgroup) of the user </para></listitem>
245 <listitem><para>don't prompt for a password </para></listitem>
250 <term>iocharset</term>
252 <listitem><para>Charset used to convert local path names to and from
253 Unicode. Unicode is used by default for network path
254 names if the server supports it. If iocharset is
255 not specified then the nls_default specified
256 during the local client kernel build will be used.
257 If server does not support Unicode, this parameter is
258 unused. </para></listitem>
265 <listitem><para>mount read-only</para></listitem>
271 <listitem><para>mount read-write</para></listitem>
276 <listitem><para>If the CIFS Unix extensions are negotiated with the server
277 the client will attempt to set the effective uid and gid of
278 the local process on newly created files, directories, and
279 devices (create, mkdir, mknod). If the CIFS Unix Extensions
280 are not negotiated, for newly created files and directories
281 instead of using the default uid and gid specified on the
282 the mount, cache the new file's uid and gid locally which means
283 that the uid for the file can change when the inode is
284 reloaded (or the user remounts the share).</para></listitem>
288 <term>nosetuids</term>
289 <listitem><para>The client will not attempt to set the uid and gid on
290 on newly created files, directories, and devices (create,
291 mkdir, mknod) which will result in the server setting the
292 uid and gid to the default (usually the server uid of the
293 user who mounted the share). Letting the server (rather than
294 the client) set the uid and gid is the default.If the CIFS
295 Unix Extensions are not negotiated then the uid and gid for
296 new files will appear to be the uid (gid) of the mounter or the
297 uid (gid) parameter specified on the mount.</para></listitem>
302 <listitem><para>Client does permission checks (vfs_permission check of uid
303 and gid of the file against the mode and desired operation),
304 Note that this is in addition to the normal ACL check on the
305 target machine done by the server software.
306 Client permission checking is enabled by default.</para></listitem>
311 <listitem><para>Client does not do permission checks. This can expose
312 files on this mount to access by other users on the local
313 client system. It is typically only needed when the server
314 supports the CIFS Unix Extensions but the UIDs/GIDs on the
315 client and server system do not match closely enough to allow
316 access by the user doing the mount.
317 Note that this does not affect the normal ACL check on the
318 target machine done by the server software (of the server
319 ACL against the user name provided at mount time).</para></listitem>
324 <listitem><para>Instructs the server to maintain ownership and
325 permissions in memory that can't be stored on the server. This information can disappear at any time (whenever the inode is flushed from the cache), so while this may help make some applications work, it's behavior is somewhat unreliable. See the section below on FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS for more information.
330 <term>directio</term>
331 <listitem><para>Do not do inode data caching on files opened on this mount.
332 This precludes mmaping files on this mount. In some cases
333 with fast networks and little or no caching benefits on the
334 client (e.g. when the application is doing large sequential
335 reads bigger than page size without rereading the same data)
336 this can provide better performance than the default
337 behavior which caches reads (readahead) and writes
338 (writebehind) through the local Linux client pagecache
339 if oplock (caching token) is granted and held. Note that
340 direct allows write operations larger than page size
341 to be sent to the server. On some kernels this requires the cifs.ko module
342 to be built with the CIFS_EXPERIMENTAL configure option.</para></listitem>
346 <term>mapchars</term>
347 <listitem><para>Translate six of the seven reserved characters (not backslash, but including the colon, question mark, pipe, asterik, greater than and less than characters)
348 to the remap range (above 0xF000), which also
349 allows the CIFS client to recognize files created with
350 such characters by Windows's POSIX emulation. This can
351 also be useful when mounting to most versions of Samba
352 (which also forbids creating and opening files
353 whose names contain any of these seven characters).
354 This has no effect if the server does not support
355 Unicode on the wire. Please note that the files created
356 with mapchars mount option may not be accessible
357 if the share is mounted without that option.</para></listitem>
361 <term>nomapchars</term>
362 <listitem><para>Do not translate any of these seven characters (default)</para></listitem>
367 <listitem><para>currently unimplemented</para></listitem>
372 <listitem><para>(default) currently unimplemented </para></listitem>
377 <listitem><para>The program accessing a file on the cifs mounted file system will hang when the
378 server crashes.</para></listitem>
383 <listitem><para>(default) The program accessing a file on the cifs mounted file system will not hang when the server crashes and will return errors to the user application.</para></listitem>
388 <listitem><para>Do not allow POSIX ACL operations even if server would support them.</para><para>
389 The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
390 version 3.0.10 and later. Setting POSIX ACLs requires enabling both XATTR and
391 then POSIX support in the CIFS configuration options when building the cifs
392 module. POSIX ACL support can be disabled on a per mount basis by specifying
393 "noacl" on mount.</para>
400 <para>Request case insensitive path name matching (case
401 sensitive is the default if the server suports it).
409 <para>Security mode. Allowed values are:</para>
411 <listitem><para>none attempt to connection as a null user (no name) </para></listitem>
412 <listitem><para>krb5 Use Kerberos version 5 authentication</para></listitem>
413 <listitem><para>krb5i Use Kerberos authentication and packet signing</para></listitem>
414 <listitem><para>ntlm Use NTLM password hashing (default)</para></listitem>
415 <listitem><para>ntlmi Use NTLM password hashing with signing (if
416 /proc/fs/cifs/PacketSigningEnabled on or if
417 server requires signing also can be the default)</para></listitem>
418 <listitem><para>ntlmv2 Use NTLMv2 password hashing</para></listitem>
419 <listitem><para>ntlmv2i Use NTLMv2 password hashing with packet signing</para></listitem>
422 <para>[NB This [sec parameter] is under development and expected to be available in cifs kernel module 1.40 and later]
430 <para>Do not send byte range lock requests to the server.
431 This is necessary for certain applications that break
432 with cifs style mandatory byte range locks (and most
433 cifs servers do not yet support requesting advisory
443 When the CIFS Unix Extensions are not negotiated, attempt to
444 create device files and fifos in a format compatible with
445 Services for Unix (SFU). In addition retrieve bits 10-12
446 of the mode via the SETFILEBITS extended attribute (as
447 SFU does). In the future the bottom 9 bits of the mode
448 mode also will be emulated using queries of the security
449 descriptor (ACL). [NB: requires version 1.39 or later
450 of the CIFS VFS. To recognize symlinks and be able
451 to create symlinks in an SFU interoperable form
452 requires version 1.40 or later of the CIFS VFS kernel module.
458 <term>serverino</term>
459 <listitem><para>Use inode numbers (unique persistent file identifiers)
460 returned by the server instead of automatically generating
461 temporary inode numbers on the client. Although server inode numbers
462 make it easier to spot hardlinked files (as they will have
463 the same inode numbers) and inode numbers may be persistent (which is
464 userful for some sofware),
465 the server does not guarantee that the inode numbers
466 are unique if multiple server side mounts are exported under a
467 single share (since inode numbers on the servers might not
468 be unique if multiple filesystems are mounted under the same
469 shared higher level directory). Note that not all
470 servers support returning server inode numbers, although
471 those that support the CIFS Unix Extensions, and Windows 2000 and
472 later servers typically do support this (although not necessarily
473 on every local server filesystem). Parameter has no effect if
474 the server lacks support for returning inode numbers or equivalent.
479 <term>noserverino</term>
480 <listitem><para>client generates inode numbers (rather than using the actual one
481 from the server) by default.
486 <term>nouser_xattr</term>
487 <listitem><para>(default) Do not allow getfattr/setfattr to get/set xattrs, even if server would support it otherwise. </para></listitem>
491 <term>rsize=<replaceable>arg</replaceable></term>
492 <listitem><para>default network read size (usually 16K). The client currently
493 can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize
494 defaults to 16K and may be changed (from 8K to the maximum
495 kmalloc size allowed by your kernel) at module install time
496 for cifs.ko. Setting CIFSMaxBufSize to a very large value
497 will cause cifs to use more memory and may reduce performance
498 in some cases. To use rsize greater than 127K (the original
499 cifs protocol maximum) also requires that the server support
500 a new Unix Capability flag (for very large read) which some
501 newer servers (e.g. Samba 3.0.26 or later) do. rsize can be
502 set from a minimum of 2048 to a maximum of 130048 (127K or
503 CIFSMaxBufSize, whichever is smaller)
509 <term>wsize=<replaceable>arg</replaceable></term>
511 <listitem><para>default network write size (default 57344)
512 maximum wsize currently allowed by CIFS is 57344 (fourteen
513 4096 byte pages)</para></listitem>
516 <term>--verbose</term>
517 <listitem><para>Print additional debugging information for the mount. Note that this parameter must be specified before the -o. For example:</para><para>mount -t cifs //server/share /mnt --verbose -o user=username</para></listitem>
525 <title>SERVICE FORMATTING AND DELIMITERS</title>
528 It's generally preferred to use forward slashes (/) as a delimiter in service names. They are considered to be the "universal delimiter" since they are generally not allowed to be embedded within path components on Windows machines and the client can convert them to blackslashes (\) unconditionally. Conversely, backslash characters are allowed by POSIX to be part of a path component, and can't be automatically converted in the same way.
531 mount.cifs will attempt to convert backslashes to forward slashes where it's able to do so, but it cannot do so in any path component following the sharename.
536 <title>FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS</title>
538 <para> The core CIFS protocol does not provide unix ownership
539 information or mode for files and directories. Because of this, files
540 and directories will generally appear to be owned by whatever values the
541 uid= or gid= options are set, and will have permissions set to the
542 default file_mode and dir_mode for the mount. Attempting to change these
543 values via chmod/chown will return success but have no effect.</para>
545 <para>When the client and server negotiate unix extensions,
546 files and directories will be assigned the uid, gid, and mode provided
547 by the server. Because CIFS mounts are generally single-user, and the
548 same credentials are used no matter what user accesses the mount, newly
549 created files and directories will generally be given ownership
550 corresponding to whatever credentials were used to mount the
553 <para>If the uid's and gid's being used do not match on the
554 client and server, the forceuid and forcegid options may be helpful.
555 Note however, that there is no corresponding option to override the
556 mode. Permissions assigned to a file when forceuid or forcegid are in
557 effect may not reflect the the real permissions.</para>
559 <para>When unix extensions are not negotiated, it's also
560 possible to emulate them locally on the server using the "dynperm" mount
561 option. When this mount option is in effect, newly created files and
562 directories will receive what appear to be proper permissions. These
563 permissions are not stored on the server however and can disappear at
564 any time in the future (subject to the whims of the kernel flushing out
565 the inode cache). In general, this mount option is discouraged.
568 <para>It's also possible to override permission checking on the client
569 altogether via the noperm option. Server-side permission checks cannot be
570 overriden. The permission checks done by the server will always correspond to
571 the credentials used to mount the share, and not necessarily to the user who is accessing the share.</para>
576 <title>ENVIRONMENT VARIABLES</title>
579 The variable <emphasis>USER</emphasis> may contain the username of the
580 person to be used to authenticate to the server.
581 The variable can be used to set both username and
582 password by using the format username%password.
586 The variable <emphasis>PASSWD</emphasis> may contain the password of the
587 person using the client.
591 The variable <emphasis>PASSWD_FILE</emphasis> may contain the pathname
592 of a file to read the password from. A single line of input is
593 read and used as the password.
601 <para>This command may be used only by root, unless installed setuid, in which case the noeexec and nosuid mount flags are enabled. When installed as a setuid program, the program follows the conventions set forth by the mount program for user mounts.</para>
604 Some samba client tools like smbclient(8) honour client-side
605 configuration parameters present in smb.conf. Unlike those
606 client tools, <emphasis>mount.cifs</emphasis> ignores smb.conf
613 <title>CONFIGURATION</title>
615 The primary mechanism for making configuration changes and for reading
616 debug information for the cifs vfs is via the Linux /proc filesystem.
617 In the directory <filename>/proc/fs/cifs</filename> are various
618 configuration files and pseudo files which can display debug information.
619 There are additional startup options such as maximum buffer size and number
620 of buffers which only may be set when the kernel cifs vfs (cifs.ko module) is
621 loaded. These can be seen by running the modinfo utility against the file
622 cifs.ko which will list the options that may be passed to cifs during module
623 installation (device driver load).
624 For more information see the kernel file <filename>fs/cifs/README</filename>.
631 <para>Mounting using the CIFS URL specification is currently not supported.
634 <para>The credentials file does not handle usernames or passwords with
635 leading space.</para>
638 Note that the typical response to a bug report is a suggestion
639 to try the latest version first. So please try doing that first,
640 and always include which versions you use of relevant software
641 when reporting bugs (minimum: mount.cifs (try mount.cifs -V), kernel (see /proc/version) and
642 server type you are trying to contact.
649 <title>VERSION</title>
651 <para>This man page is correct for version 1.52 of
652 the cifs vfs filesystem (roughly Linux kernel 2.6.24).</para>
656 <title>SEE ALSO</title>
658 Documentation/filesystems/cifs.txt and fs/cifs/README in the linux kernel
659 source tree may contain additional options and information.
661 <para><citerefentry><refentrytitle>umount.cifs</refentrytitle>
662 <manvolnum>8</manvolnum></citerefentry></para>
667 <title>AUTHOR</title>
669 <para>Steve French</para>
671 <para>The syntax and manpage were loosely based on that of smbmount. It
672 was converted to Docbook/XML by Jelmer Vernooij.</para>
674 <para>The maintainer of the Linux cifs vfs and the userspace
675 tool <emphasis>mount.cifs</emphasis> is <ulink url="mailto:sfrench@samba.org">Steve French</ulink>.
676 The <ulink url="mailto:linux-cifs-client@lists.samba.org">Linux CIFS Mailing list</ulink>
677 is the preferred place to ask questions regarding these programs.