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.3</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>.
50 It is possible to set the mode for mount.cifs to setuid root to allow
51 non-root users to mount shares to directories for which they
52 have write permission.
56 Options to <emphasis>mount.cifs</emphasis> are specified as a comma-separated
57 list of key=value pairs. It is possible to send options other
58 than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them.
59 Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the
64 <para><emphasis>mount.cifs</emphasis> causes the cifs vfs to launch a thread named cifsd. After mounting it keeps running until
65 the mounted resource is unmounted (usually via the umount utility).
71 <title>OPTIONS</title>
73 <varlistentry><term>user=<replaceable>arg</replaceable></term>
75 <listitem><para>specifies the username to connect as. If
76 this is not given, then the environment variable <emphasis>USER</emphasis> is used. This option can also take the
77 form "user%password" or "workgroup/user" or
78 "workgroup/user%password" to allow the password and workgroup
79 to be specified as part of the username.
84 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>.
91 <varlistentry><term>password=<replaceable>arg</replaceable></term>
93 <listitem><para>specifies the CIFS password. If this
94 option is not given then the environment variable
95 <emphasis>PASSWD</emphasis> is used. If the password is not specified
96 directly or indirectly via an argument to mount, <emphasis>mount.cifs</emphasis> will prompt
97 for a password, unless the guest option is specified.
100 <para>Note that a password which contains the delimiter
101 character (i.e. a comma ',') will fail to be parsed correctly
102 on the command line. However, the same password defined
103 in the PASSWD environment variable or via a credentials file (see
104 below) or entered at the password prompt will be read correctly.
106 </listitem></varlistentry>
108 <varlistentry><term>credentials=<replaceable>filename</replaceable></term>
111 specifies a file that contains a username
112 and/or password and optionally the name of the
113 workgroup. The format of the file is:
117 username=<replaceable>value</replaceable>
118 password=<replaceable>value</replaceable>
119 workgroup=<replaceable>value</replaceable>
123 This is preferred over having passwords in plaintext in a
124 shared file, such as <filename>/etc/fstab</filename>. Be sure to protect any
125 credentials file properly.
127 </listitem></varlistentry>
130 <term>uid=<replaceable>arg</replaceable></term>
132 <listitem><para>sets the uid that will own all files on
133 the mounted filesystem.
134 It may be specified as either a username or a numeric uid.
135 For mounts to servers which do support the CIFS Unix extensions,
136 such as a properly configured Samba server, the server provides
137 the uid, gid and mode so this parameter should not be
138 specified unless the server and client uid and gid
139 numbering differ. If the server and client are in the
140 same domain (e.g. running winbind or nss_ldap) and
141 the server supports the Unix Extensions then the uid
142 and gid can be retrieved from the server (and uid
143 and gid would not have to be specified on the mount.
144 For servers which do not support the CIFS Unix
145 extensions, the default uid (and gid) returned on lookup
146 of existing files will be the uid (gid) of the person
147 who executed the mount (root, except when mount.cifs
148 is configured setuid for user mounts) unless the "uid="
149 (gid) mount option is specified. For the uid (gid) of newly
150 created files and directories, ie files created since
151 the last mount of the server share, the expected uid
152 (gid) is cached as long as the inode remains in
153 memory on the client. Also note that permission
154 checks (authorization checks) on accesses to a file occur
155 at the server, but there are cases in which an administrator
156 may want to restrict at the client as well. For those
157 servers which do not report a uid/gid owner
158 (such as Windows), permissions can also be checked at the
159 client, and a crude form of client side permission checking
160 can be enabled by specifying file_mode and dir_mode on
161 the client. Note that the mount.cifs helper must be
162 at version 1.10 or higher to support specifying the uid
163 (or gid) in non-numeric form.
168 <term>gid=<replaceable>arg</replaceable></term>
170 <listitem><para>sets the gid that will own all files on
171 the mounted filesystem. It may be specified as either a groupname or a numeric
172 gid. For other considerations see the description of uid above.
177 <term>port=<replaceable>arg</replaceable></term>
179 <listitem><para>sets the port number on the server to attempt to contact to negotiate
180 CIFS support. If the CIFS server is not listening on this port or
181 if it is not specified, the default ports will be tried i.e.
182 port 445 is tried and if no response then port 139 is tried.
187 <term>servern=<replaceable>arg</replaceable></term>
190 Specify the server netbios name (RFC1001 name) to use
191 when attempting to setup a session to the server. Although
192 rarely needed for mounting to newer servers, this option
193 is needed for mounting to some older servers (such
194 as OS/2 or Windows 98 and Windows ME) since when connecting
195 over port 139 they, unlike most newer servers, do not
196 support a default server name. A server name can be up
197 to 15 characters long and is usually uppercased.
202 <term>netbiosname=<replaceable>arg</replaceable></term>
204 <listitem><para>When mounting to servers via port 139, specifies the RFC1001
205 source name to use to represent the client netbios machine
206 name when doing the RFC1001 netbios session initialize.
211 <term>file_mode=<replaceable>arg</replaceable></term>
213 <listitem><para>If the server does not support the CIFS Unix extensions this
214 overrides the default file mode.</para></listitem>
218 <term>dir_mode=<replaceable>arg</replaceable></term>
220 <listitem><para>If the server does not support the CIFS Unix extensions this
221 overrides the default mode for directories. </para></listitem>
225 <term>ip=<replaceable>arg</replaceable></term>
227 <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>
231 <term>domain=<replaceable>arg</replaceable></term>
233 <listitem><para>sets the domain (workgroup) of the user </para></listitem>
239 <listitem><para>don't prompt for a password </para></listitem>
244 <term>iocharset</term>
246 <listitem><para>Charset used to convert local path names to and from
247 Unicode. Unicode is used by default for network path
248 names if the server supports it. If iocharset is
249 not specified then the nls_default specified
250 during the local client kernel build will be used.
251 If server does not support Unicode, this parameter is
252 unused. </para></listitem>
259 <listitem><para>mount read-only</para></listitem>
265 <listitem><para>mount read-write</para></listitem>
270 <listitem><para>If the CIFS Unix extensions are negotiated with the server
271 the client will attempt to set the effective uid and gid of
272 the local process on newly created files, directories, and
273 devices (create, mkdir, mknod). If the CIFS Unix Extensions
274 are not negotiated, for newly created files and directories
275 instead of using the default uid and gid specified on the
276 the mount, cache the new file's uid and gid locally which means
277 that the uid for the file can change when the inode is
278 reloaded (or the user remounts the share).</para></listitem>
282 <term>nosetuids</term>
283 <listitem><para>The client will not attempt to set the uid and gid on
284 on newly created files, directories, and devices (create,
285 mkdir, mknod) which will result in the server setting the
286 uid and gid to the default (usually the server uid of the
287 user who mounted the share). Letting the server (rather than
288 the client) set the uid and gid is the default.If the CIFS
289 Unix Extensions are not negotiated then the uid and gid for
290 new files will appear to be the uid (gid) of the mounter or the
291 uid (gid) parameter specified on the mount.</para></listitem>
296 <listitem><para>Client does permission checks (vfs_permission check of uid
297 and gid of the file against the mode and desired operation),
298 Note that this is in addition to the normal ACL check on the
299 target machine done by the server software.
300 Client permission checking is enabled by default.</para></listitem>
305 <listitem><para>Client does not do permission checks. This can expose
306 files on this mount to access by other users on the local
307 client system. It is typically only needed when the server
308 supports the CIFS Unix Extensions but the UIDs/GIDs on the
309 client and server system do not match closely enough to allow
310 access by the user doing the mount.
311 Note that this does not affect the normal ACL check on the
312 target machine done by the server software (of the server
313 ACL against the user name provided at mount time).</para></listitem>
317 <term>directio</term>
318 <listitem><para>Do not do inode data caching on files opened on this mount.
319 This precludes mmaping files on this mount. In some cases
320 with fast networks and little or no caching benefits on the
321 client (e.g. when the application is doing large sequential
322 reads bigger than page size without rereading the same data)
323 this can provide better performance than the default
324 behavior which caches reads (readahead) and writes
325 (writebehind) through the local Linux client pagecache
326 if oplock (caching token) is granted and held. Note that
327 direct allows write operations larger than page size
328 to be sent to the server. On some kernels this requires the cifs.ko module
329 to be built with the CIFS_EXPERIMENTAL configure option.</para></listitem>
333 <term>mapchars</term>
334 <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)
335 to the remap range (above 0xF000), which also
336 allows the CIFS client to recognize files created with
337 such characters by Windows's POSIX emulation. This can
338 also be useful when mounting to most versions of Samba
339 (which also forbids creating and opening files
340 whose names contain any of these seven characters).
341 This has no effect if the server does not support
342 Unicode on the wire.</para></listitem>
346 <term>nomapchars</term>
347 <listitem><para>Do not translate any of these seven characters (default)</para></listitem>
352 <listitem><para>currently unimplemented</para></listitem>
357 <listitem><para>(default) currently unimplemented </para></listitem>
362 <listitem><para>The program accessing a file on the cifs mounted file system will hang when the
363 server crashes.</para></listitem>
368 <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>
373 <listitem><para>Do not allow POSIX ACL operations even if server would support them.</para><para>
374 The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
375 version 3.0.10 and later. Setting POSIX ACLs requires enabling both XATTR and
376 then POSIX support in the CIFS configuration options when building the cifs
377 module. POSIX ACL support can be disabled on a per mount basis by specifying
378 "noacl" on mount.</para>
385 <para>Request case insensitive path name matching (case
386 sensitive is the default if the server suports it).
394 <para>Security mode. Allowed values are:</para>
396 <listitem><para>none attempt to connection as a null user (no name) </para></listitem>
397 <listitem><para>krb5 Use Kerberos version 5 authentication</para></listitem>
398 <listitem><para>krb5i Use Kerberos authentication and packet signing</para></listitem>
399 <listitem><para>ntlm Use NTLM password hashing (default)</para></listitem>
400 <listitem><para>ntlmi Use NTLM password hashing with signing (if
401 /proc/fs/cifs/PacketSigningEnabled on or if
402 server requires signing also can be the default)</para></listitem>
403 <listitem><para>ntlmv2 Use NTLMv2 password hashing</para></listitem>
404 <listitem><para>ntlmv2i Use NTLMv2 password hashing with packet signing</para></listitem>
407 <para>[NB This [sec parameter] is under development and expected to be available in cifs kernel module 1.40 and later]
415 <para>Do not send byte range lock requests to the server.
416 This is necessary for certain applications that break
417 with cifs style mandatory byte range locks (and most
418 cifs servers do not yet support requesting advisory
428 When the CIFS Unix Extensions are not negotiated, attempt to
429 create device files and fifos in a format compatible with
430 Services for Unix (SFU). In addition retrieve bits 10-12
431 of the mode via the SETFILEBITS extended attribute (as
432 SFU does). In the future the bottom 9 bits of the mode
433 mode also will be emulated using queries of the security
434 descriptor (ACL). [NB: requires version 1.39 or later
435 of the CIFS VFS. To recognize symlinks and be able
436 to create symlinks in an SFU interoperable form
437 requires version 1.40 or later of the CIFS VFS kernel module.
443 <term>serverino</term>
444 <listitem><para>Use inode numbers (unique persistent file identifiers)
445 returned by the server instead of automatically generating
446 temporary inode numbers on the client. Although server inode numbers
447 make it easier to spot hardlinked files (as they will have
448 the same inode numbers) and inode numbers may be persistent (which is
449 userful for some sofware),
450 the server does not guarantee that the inode numbers
451 are unique if multiple server side mounts are exported under a
452 single share (since inode numbers on the servers might not
453 be unique if multiple filesystems are mounted under the same
454 shared higher level directory). Note that not all
455 servers support returning server inode numbers, although
456 those that support the CIFS Unix Extensions, and Windows 2000 and
457 later servers typically do support this (although not necessarily
458 on every local server filesystem). Parameter has no effect if
459 the server lacks support for returning inode numbers or equivalent.
464 <term>noserverino</term>
465 <listitem><para>client generates inode numbers (rather than using the actual one
466 from the server) by default.
471 <term>nouser_xattr</term>
472 <listitem><para>(default) Do not allow getfattr/setfattr to get/set xattrs, even if server would support it otherwise. </para></listitem>
476 <term>rsize=<replaceable>arg</replaceable></term>
477 <listitem><para>default network read size (usually 16K). The client currently
478 can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize
479 defaults to 16K and may be changed (from 8K to the maximum
480 kmalloc size allowed by your kernel) at module install time
481 for cifs.ko. Setting CIFSMaxBufSize to a very large value
482 will cause cifs to use more memory and may reduce performance
483 in some cases. To use rsize greater than 127K (the original
484 cifs protocol maximum) also requires that the server support
485 a new Unix Capability flag (for very large read) which some
486 newer servers (e.g. Samba 3.0.26 or later) do. rsize can be
487 set from a minimum of 2048 to a maximum of 130048 (127K or
488 CIFSMaxBufSize, whichever is smaller)
494 <term>wsize=<replaceable>arg</replaceable></term>
496 <listitem><para>default network write size (default 57344)
497 maximum wsize currently allowed by CIFS is 57344 (fourteen
498 4096 byte pages)</para></listitem>
501 <term>--verbose</term>
502 <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>
510 <title>SERVICE FORMATTING AND DELIMITERS</title>
513 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.
516 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.
521 <title>ENVIRONMENT VARIABLES</title>
524 The variable <emphasis>USER</emphasis> may contain the username of the
525 person to be used to authenticate to the server.
526 The variable can be used to set both username and
527 password by using the format username%password.
531 The variable <emphasis>PASSWD</emphasis> may contain the password of the
532 person using the client.
536 The variable <emphasis>PASSWD_FILE</emphasis> may contain the pathname
537 of a file to read the password from. A single line of input is
538 read and used as the password.
546 <para>This command may be used only by root, unless installed setuid, in which case the noeexec and nosuid mount flags are enabled.</para>
550 <title>CONFIGURATION</title>
552 The primary mechanism for making configuration changes and for reading
553 debug information for the cifs vfs is via the Linux /proc filesystem.
554 In the directory <filename>/proc/fs/cifs</filename> are various
555 configuration files and pseudo files which can display debug information.
556 There are additional startup options such as maximum buffer size and number
557 of buffers which only may be set when the kernel cifs vfs (cifs.ko module) is
558 loaded. These can be seen by running the modinfo utility against the file
559 cifs.ko which will list the options that may be passed to cifs during module
560 installation (device driver load).
561 For more information see the kernel file <filename>fs/cifs/README</filename>.
568 <para>Mounting using the CIFS URL specification is currently not supported.
571 <para>The credentials file does not handle usernames or passwords with
572 leading space.</para>
575 Note that the typical response to a bug report is a suggestion
576 to try the latest version first. So please try doing that first,
577 and always include which versions you use of relevant software
578 when reporting bugs (minimum: mount.cifs (try mount.cifs -V), kernel (see /proc/version) and
579 server type you are trying to contact.
586 <title>VERSION</title>
588 <para>This man page is correct for version 1.52 of
589 the cifs vfs filesystem (roughly Linux kernel 2.6.24).</para>
593 <title>SEE ALSO</title>
595 Documentation/filesystems/cifs.txt and fs/cifs/README in the linux kernel
596 source tree may contain additional options and information.
598 <para><citerefentry><refentrytitle>umount.cifs</refentrytitle>
599 <manvolnum>8</manvolnum></citerefentry></para>
604 <title>AUTHOR</title>
606 <para>Steve French</para>
608 <para>The syntax and manpage were loosely based on that of smbmount. It
609 was converted to Docbook/XML by Jelmer Vernooij.</para>
611 <para>The maintainer of the Linux cifs vfs and the userspace
612 tool <emphasis>mount.cifs</emphasis> is <ulink url="mailto:sfrench@samba.org">Steve French</ulink>.
613 The <ulink url="mailto:linux-cifs-client@lists.samba.org">Linux CIFS Mailing list</ulink>
614 is the preferred place to ask questions regarding these programs.