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>
12 <refname>mount.cifs</refname>
13 <refpurpose>mount using the Common Internet File System (CIFS)</refpurpose>
19 <command>mount.cifs</command>
20 <arg choice="req">service</arg>
21 <arg choice="req">mount-point</arg>
22 <arg choice="opt">-o options</arg>
27 <title>DESCRIPTION</title>
29 <para>This tool is part of the <citerefentry><refentrytitle>samba</refentrytitle>
30 <manvolnum>7</manvolnum></citerefentry> suite.</para>
32 <para>mount.cifs mounts a Linux CIFS filesystem. It
33 is usually invoked indirectly by
34 the <citerefentry><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> command when using the
35 "-t cifs" option. This command only works in Linux, and the kernel must
36 support the cifs filesystem. The CIFS protocol is the successor to the
37 SMB protocol and is supported by most Windows servers and many other
38 commercial servers and Network Attached Storage appliances as well as
39 by the popular Open Source server Samba.
43 The mount.cifs utility attaches the UNC name (exported network resource) to
44 the local directory <emphasis>mount-point</emphasis>. It is possible to set the mode for mount.cifs to
45 setuid root to allow non-root users to mount shares to directories for which they
46 have write permission.
50 Options to <emphasis>mount.cifs</emphasis> are specified as a comma-separated
51 list of key=value pairs. It is possible to send options other
52 than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them.
53 Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the
58 <para><emphasis>mount.cifs</emphasis> causes the cifs vfs to launch a thread named cifsd. After mounting it keeps running until
59 the mounted resource is unmounted (usually via the umount utility).
65 <title>OPTIONS</title>
67 <varlistentry><term>user=<replaceable>arg</replaceable></term>
69 <listitem><para>specifies the username to connect as. If
70 this is not given, then the environment variable <emphasis>USER</emphasis> is used. This option can also take the
71 form "user%password" or "workgroup/user" or
72 "workgroup/user%password" to allow the password and workgroup
73 to be specified as part of the username.
78 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>.
85 <varlistentry><term>password=<replaceable>arg</replaceable></term>
87 <listitem><para>specifies the CIFS password. If this
88 option is not given then the environment variable
89 <emphasis>PASSWD</emphasis> is used. If the password is not specified
90 directly or indirectly via an argument to mount, <emphasis>mount.cifs</emphasis> will prompt
91 for a password, unless the guest option is specified.
94 <para>Note that a password which contains the delimiter
95 character (i.e. a comma ',') will fail to be parsed correctly
96 on the command line. However, the same password defined
97 in the PASSWD environment variable or via a credentials file (see
98 below) or entered at the password prompt will be read correctly.
100 </listitem></varlistentry>
102 <varlistentry><term>credentials=<replaceable>filename</replaceable></term>
105 specifies a file that contains a username
106 and/or password. The format of the file is:
110 username=<replaceable>value</replaceable>
111 password=<replaceable>value</replaceable>
115 This is preferred over having passwords in plaintext in a
116 shared file, such as <filename>/etc/fstab</filename>. Be sure to protect any
117 credentials file properly.
119 </listitem></varlistentry>
122 <term>uid=<replaceable>arg</replaceable></term>
124 <listitem><para>sets the uid that will own all files on
125 the mounted filesystem.
126 It may be specified as either a username or a numeric uid.
127 For mounts to servers which do support the CIFS Unix extensions,
128 such as a properly configured Samba server, the server provides
129 the uid, gid and mode so this parameter should not be
130 specified unless the server and client uid and gid
131 numbering differ. If the server and client are in the
132 same domain (e.g. running winbind or nss_ldap) and
133 the server supports the Unix Extensions then the uid
134 and gid can be retrieved from the server (and uid
135 and gid would not have to be specifed on the mount.
136 For servers which do not support the CIFS Unix
137 extensions, the default uid (and gid) returned on lookup
138 of existing files will be the uid (gid) of the person
139 who executed the mount (root, except when mount.cifs
140 is configured setuid for user mounts) unless the "uid="
141 (gid) mount option is specified. For the uid (gid) of newly
142 created files and directories, ie files created since
143 the last mount of the server share, the expected uid
144 (gid) is cached as long as the inode remains in
145 memory on the client. Also note that permission
146 checks (authorization checks) on accesses to a file occur
147 at the server, but there are cases in which an administrator
148 may want to restrict at the client as well. For those
149 servers which do not report a uid/gid owner
150 (such as Windows), permissions can also be checked at the
151 client, and a crude form of client side permission checking
152 can be enabled by specifying file_mode and dir_mode on
153 the client. Note that the mount.cifs helper must be
154 at version 1.10 or higher to support specifying the uid
155 (or gid) in non-numeric form.
160 <term>gid=<replaceable>arg</replaceable></term>
162 <listitem><para>sets the gid that will own all files on
163 the mounted filesystem. It may be specified as either a groupname or a numeric
164 gid. For other considerations see the description of uid above.
169 <term>port=<replaceable>arg</replaceable></term>
171 <listitem><para>sets the port number on the server to attempt to contact to negotiate
172 CIFS support. If the CIFS server is not listening on this port or
173 if it is not specified, the default ports will be tried i.e.
174 port 445 is tried and if no response then port 139 is tried.
179 <term>servern=<replaceable>arg</replaceable></term>
182 Specify the server netbios name (RFC1001 name) to use
183 when attempting to setup a session to the server. Although
184 rarely needed for mounting to newer servers, this option
185 is needed for mounting to some older servers (such
186 as OS/2 or Windows 98 and Windows ME) since when connecting
187 over port 139 they, unlike most newer servers, do not
188 support a default server name. A server name can be up
189 to 15 characters long and is usually uppercased.
194 <term>netbiosname=<replaceable>arg</replaceable></term>
196 <listitem><para>When mounting to servers via port 139, specifies the RFC1001
197 source name to use to represent the client netbios machine
198 name when doing the RFC1001 netbios session initialize.
203 <term>file_mode=<replaceable>arg</replaceable></term>
205 <listitem><para>If the server does not support the CIFS Unix extensions this
206 overrides the default file mode.</para></listitem>
210 <term>dir_mode=<replaceable>arg</replaceable></term>
212 <listitem><para>If the server does not support the CIFS Unix extensions this
213 overrides the default mode for directories. </para></listitem>
217 <term>ip=<replaceable>arg</replaceable></term>
219 <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>
223 <term>domain=<replaceable>arg</replaceable></term>
225 <listitem><para>sets the domain (workgroup) of the user </para></listitem>
231 <listitem><para>don't prompt for a password </para></listitem>
236 <term>iocharset</term>
238 <listitem><para>Charset used to convert local path names to and from
239 Unicode. Unicode is used by default for network path
240 names if the server supports it. If iocharset is
241 not specified then the nls_default specified
242 during the local client kernel build will be used.
243 If server does not support Unicode, this parameter is
244 unused. </para></listitem>
251 <listitem><para>mount read-only</para></listitem>
257 <listitem><para>mount read-write</para></listitem>
262 <listitem><para>If the CIFS Unix extensions are negotiated with the server
263 the client will attempt to set the effective uid and gid of
264 the local process on newly created files, directories, and
265 devices (create, mkdir, mknod). If the CIFS Unix Extensions
266 are not negotiated, for newly created files and directories
267 instead of using the default uid and gid specified on the
268 the mount, cache the new file's uid and gid locally which means
269 that the uid for the file can change when the inode is
270 reloaded (or the user remounts the share).</para></listitem>
274 <term>nosetuids</term>
275 <listitem><para>The client will not attempt to set the uid and gid on
276 on newly created files, directories, and devices (create,
277 mkdir, mknod) which will result in the server setting the
278 uid and gid to the default (usually the server uid of the
279 user who mounted the share). Letting the server (rather than
280 the client) set the uid and gid is the default.If the CIFS
281 Unix Extensions are not negotiated then the uid and gid for
282 new files will appear to be the uid (gid) of the mounter or the
283 uid (gid) parameter specified on the mount.</para></listitem>
288 <listitem><para>Client does permission checks (vfs_permission check of uid
289 and gid of the file against the mode and desired operation),
290 Note that this is in addition to the normal ACL check on the
291 target machine done by the server software.
292 Client permission checking is enabled by default.</para></listitem>
297 <listitem><para>Client does not do permission checks. This can expose
298 files on this mount to access by other users on the local
299 client system. It is typically only needed when the server
300 supports the CIFS Unix Extensions but the UIDs/GIDs on the
301 client and server system do not match closely enough to allow
302 access by the user doing the mount.
303 Note that this does not affect the normal ACL check on the
304 target machine done by the server software (of the server
305 ACL against the user name provided at mount time).</para></listitem>
309 <term>directio</term>
310 <listitem><para>Do not do inode data caching on files opened on this mount.
311 This precludes mmaping files on this mount. In some cases
312 with fast networks and little or no caching benefits on the
313 client (e.g. when the application is doing large sequential
314 reads bigger than page size without rereading the same data)
315 this can provide better performance than the default
316 behavior which caches reads (readahead) and writes
317 (writebehind) through the local Linux client pagecache
318 if oplock (caching token) is granted and held. Note that
319 direct allows write operations larger than page size
320 to be sent to the server. On some kernels this requires the cifs.ko module
321 to be built with the CIFS_EXPERIMENTAL configure option.</para></listitem>
325 <term>mapchars</term>
326 <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)
327 to the remap range (above 0xF000), which also
328 allows the CIFS client to recognize files created with
329 such characters by Windows's POSIX emulation. This can
330 also be useful when mounting to most versions of Samba
331 (which also forbids creating and opening files
332 whose names contain any of these seven characters).
333 This has no effect if the server does not support
334 Unicode on the wire.</para></listitem>
338 <term>nomapchars</term>
339 <listitem><para>Do not translate any of these seven characters (default)</para></listitem>
344 <listitem><para>currently unimplemented</para></listitem>
349 <listitem><para>(default) currently unimplemented </para></listitem>
354 <listitem><para>The program accessing a file on the cifs mounted file system will hang when the
355 server crashes.</para></listitem>
360 <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>
365 <listitem><para>Do not allow POSIX ACL operations even if server would support them.</para><para>
366 The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
367 version 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and
368 then POSIX support in the CIFS configuration options when building the cifs
369 module. POSIX ACL support can be disabled on a per mount basic by specifying
370 "noacl" on mount.</para>
377 <para>Request case insensitive path name matching (case
378 sensitive is the default if the server suports it).
386 <para>Security mode. Allowed values are:</para>
388 <listitem><para>none attempt to connection as a null user (no name) </para></listitem>
389 <listitem><para>krb5 Use Kerberos version 5 authentication</para></listitem>
390 <listitem><para>krb5i Use Kerberos authentication and packet signing</para></listitem>
391 <listitem><para>ntlm Use NTLM password hashing (default)</para></listitem>
392 <listitem><para>ntlmi Use NTLM password hashing with signing (if
393 /proc/fs/cifs/PacketSigningEnabled on or if
394 server requires signing also can be the default)</para></listitem>
395 <listitem><para>ntlmv2 Use NTLMv2 password hashing</para></listitem>
396 <listitem><para>ntlmv2i Use NTLMv2 password hashing with packet signing</para></listitem>
399 <para>[NB This [sec parameter] is under development and expected to be available in cifs kernel module 1.40 and later]
407 <para>Do not send byte range lock requests to the server.
408 This is necessary for certain applications that break
409 with cifs style mandatory byte range locks (and most
410 cifs servers do not yet support requesting advisory
420 When the CIFS Unix Extensions are not negotiated, attempt to
421 create device files and fifos in a format compatible with
422 Services for Unix (SFU). In addition retrieve bits 10-12
423 of the mode via the SETFILEBITS extended attribute (as
424 SFU does). In the future the bottom 9 bits of the mode
425 mode also will be emulated using queries of the security
426 descriptor (ACL). [NB: requires version 1.39 or later
427 of the CIFS VFS. To recognize symlinks and be able
428 to create symlinks in an SFU interoperable form
429 requires version 1.40 or later of the CIFS VFS kernel module.
435 <term>serverino</term>
436 <listitem><para>Use inode numbers (unique persistent file identifiers)
437 returned by the server instead of automatically generating
438 temporary inode numbers on the client. Although server inode numbers
439 make it easier to spot hardlinked files (as they will have
440 the same inode numbers) and inode numbers may be persistent (which is
441 userful for some sofware),
442 the server does not guarantee that the inode numbers
443 are unique if multiple server side mounts are exported under a
444 single share (since inode numbers on the servers might not
445 be unique if multiple filesystems are mounted under the same
446 shared higher level directory). Note that not all
447 servers support returning server inode numbers, although
448 those that support the CIFS Unix Extensions, and Windows 2000 and
449 later servers typically do support this (although not necessarily
450 on every local server filesystem). Parameter has no effect if
451 the server lacks support for returning inode numbers or equivalent.
456 <term>noserverino</term>
457 <listitem><para>client generates inode numbers (rather than using the actual one
458 from the server) by default.
463 <term>nouser_xattr</term>
464 <listitem><para>(default) Do not allow getfattr/setfattr to get/set xattrs, even if server would support it otherwise. </para></listitem>
468 <term>rsize=<replaceable>arg</replaceable></term>
469 <listitem><para>default network read size (usually 16K). The client currently
470 can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize
471 defaults to 16K and may be changed (from 8K to the maximum
472 kmalloc size allowed by your kernel) at module install time
473 for cifs.ko. Setting CIFSMaxBufSize to a very large value
474 will cause cifs to use more memory and may reduce performance
475 in some cases. To use rsize greater than 127K (the original
476 cifs protocol maximum) also requires that the server support
477 a new Unix Capability flag (for very large read) which some
478 newer servers (e.g. Samba 3.0.26 or later) do. rsize can be
479 set from a minimum of 2048 to a maximum of 130048 (127K or
480 CIFSMaxBufSize, whichever is smaller)
486 <term>wsize=<replaceable>arg</replaceable></term>
488 <listitem><para>default network write size (default 57344)
489 maximum wsize currently allowed by CIFS is 57344 (fourteen
490 4096 byte pages)</para></listitem>
493 <term>--verbose</term>
494 <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>
502 <title>SERVICE FORMATTING AND DELIMITERS</title>
505 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.
508 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.
513 <title>ENVIRONMENT VARIABLES</title>
516 The variable <emphasis>USER</emphasis> may contain the username of the
517 person to be used to authenticate to the server.
518 The variable can be used to set both username and
519 password by using the format username%password.
523 The variable <emphasis>PASSWD</emphasis> may contain the password of the
524 person using the client.
528 The variable <emphasis>PASSWD_FILE</emphasis> may contain the pathname
529 of a file to read the password from. A single line of input is
530 read and used as the password.
538 <para>This command may be used only by root, unless installed setuid, in which case the noeexec and nosuid mount flags are enabled.</para>
542 <title>CONFIGURATION</title>
544 The primary mechanism for making configuration changes and for reading
545 debug information for the cifs vfs is via the Linux /proc filesystem.
546 In the directory <filename>/proc/fs/cifs</filename> are various
547 configuration files and pseudo files which can display debug information.
548 There are additional startup options such as maximum buffer size and number
549 of buffers which only may be set when the kernel cifs vfs (cifs.ko module) is
550 loaded. These can be seen by running the modinfo utility against the file
551 cifs.ko which will list the options that may be passed to cifs during module
552 installation (device driver load).
553 For more information see the kernel file <filename>fs/cifs/README</filename>.
560 <para>Mounting using the CIFS URL specification is currently not supported.
563 <para>The credentials file does not handle usernames or passwords with
564 leading space.</para>
567 Note that the typical response to a bug report is a suggestion
568 to try the latest version first. So please try doing that first,
569 and always include which versions you use of relevant software
570 when reporting bugs (minimum: mount.cifs (try mount.cifs -V), kernel (see /proc/version) and
571 server type you are trying to contact.
578 <title>VERSION</title>
580 <para>This man page is correct for version 1.52 of
581 the cifs vfs filesystem (roughly Linux kernel 2.6.24).</para>
585 <title>SEE ALSO</title>
587 Documentation/filesystems/cifs.txt and fs/cifs/README in the linux kernel
588 source tree may contain additional options and information.
590 <para><citerefentry><refentrytitle>umount.cifs</refentrytitle>
591 <manvolnum>8</manvolnum></citerefentry></para>
596 <title>AUTHOR</title>
598 <para>Steve French</para>
600 <para>The syntax and manpage were loosely based on that of smbmount. It
601 was converted to Docbook/XML by Jelmer Vernooij.</para>
603 <para>The maintainer of the Linux cifs vfs and the userspace
604 tool <emphasis>mount.cifs</emphasis> is <ulink url="mailto:sfrench@samba.org">Steve French</ulink>.
605 The <ulink url="mailto:linux-cifs-client@lists.samba.org">Linux CIFS Mailing list</ulink>
606 is the preferred place to ask questions regarding these programs.