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.2</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) to
47 the local directory <emphasis>mount-point</emphasis>. It is possible to set the mode for mount.cifs to
48 setuid root to allow non-root users to mount shares to directories for which they
49 have write permission.
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).
68 <title>OPTIONS</title>
70 <varlistentry><term>user=<replaceable>arg</replaceable></term>
72 <listitem><para>specifies the username to connect as. If
73 this is not given, then the environment variable <emphasis>USER</emphasis> is used. This option can also take the
74 form "user%password" or "workgroup/user" or
75 "workgroup/user%password" to allow the password and workgroup
76 to be specified as part of the username.
81 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>.
88 <varlistentry><term>password=<replaceable>arg</replaceable></term>
90 <listitem><para>specifies the CIFS password. If this
91 option is not given then the environment variable
92 <emphasis>PASSWD</emphasis> is used. If the password is not specified
93 directly or indirectly via an argument to mount, <emphasis>mount.cifs</emphasis> will prompt
94 for a password, unless the guest option is specified.
97 <para>Note that a password which contains the delimiter
98 character (i.e. a comma ',') will fail to be parsed correctly
99 on the command line. However, the same password defined
100 in the PASSWD environment variable or via a credentials file (see
101 below) or entered at the password prompt will be read correctly.
103 </listitem></varlistentry>
105 <varlistentry><term>credentials=<replaceable>filename</replaceable></term>
108 specifies a file that contains a username
109 and/or password. The format of the file is:
113 username=<replaceable>value</replaceable>
114 password=<replaceable>value</replaceable>
118 This is preferred over having passwords in plaintext in a
119 shared file, such as <filename>/etc/fstab</filename>. Be sure to protect any
120 credentials file properly.
122 </listitem></varlistentry>
125 <term>uid=<replaceable>arg</replaceable></term>
127 <listitem><para>sets the uid that will own all files on
128 the mounted filesystem.
129 It may be specified as either a username or a numeric uid.
130 For mounts to servers which do support the CIFS Unix extensions,
131 such as a properly configured Samba server, the server provides
132 the uid, gid and mode so this parameter should not be
133 specified unless the server and client uid and gid
134 numbering differ. If the server and client are in the
135 same domain (e.g. running winbind or nss_ldap) and
136 the server supports the Unix Extensions then the uid
137 and gid can be retrieved from the server (and uid
138 and gid would not have to be specifed on the mount.
139 For servers which do not support the CIFS Unix
140 extensions, the default uid (and gid) returned on lookup
141 of existing files will be the uid (gid) of the person
142 who executed the mount (root, except when mount.cifs
143 is configured setuid for user mounts) unless the "uid="
144 (gid) mount option is specified. For the uid (gid) of newly
145 created files and directories, ie files created since
146 the last mount of the server share, the expected uid
147 (gid) is cached as long as the inode remains in
148 memory on the client. Also note that permission
149 checks (authorization checks) on accesses to a file occur
150 at the server, but there are cases in which an administrator
151 may want to restrict at the client as well. For those
152 servers which do not report a uid/gid owner
153 (such as Windows), permissions can also be checked at the
154 client, and a crude form of client side permission checking
155 can be enabled by specifying file_mode and dir_mode on
156 the client. Note that the mount.cifs helper must be
157 at version 1.10 or higher to support specifying the uid
158 (or gid) in non-numeric form.
163 <term>gid=<replaceable>arg</replaceable></term>
165 <listitem><para>sets the gid that will own all files on
166 the mounted filesystem. It may be specified as either a groupname or a numeric
167 gid. For other considerations see the description of uid above.
172 <term>port=<replaceable>arg</replaceable></term>
174 <listitem><para>sets the port number on the server to attempt to contact to negotiate
175 CIFS support. If the CIFS server is not listening on this port or
176 if it is not specified, the default ports will be tried i.e.
177 port 445 is tried and if no response then port 139 is tried.
182 <term>servern=<replaceable>arg</replaceable></term>
185 Specify the server netbios name (RFC1001 name) to use
186 when attempting to setup a session to the server. Although
187 rarely needed for mounting to newer servers, this option
188 is needed for mounting to some older servers (such
189 as OS/2 or Windows 98 and Windows ME) since when connecting
190 over port 139 they, unlike most newer servers, do not
191 support a default server name. A server name can be up
192 to 15 characters long and is usually uppercased.
197 <term>netbiosname=<replaceable>arg</replaceable></term>
199 <listitem><para>When mounting to servers via port 139, specifies the RFC1001
200 source name to use to represent the client netbios machine
201 name when doing the RFC1001 netbios session initialize.
206 <term>file_mode=<replaceable>arg</replaceable></term>
208 <listitem><para>If the server does not support the CIFS Unix extensions this
209 overrides the default file mode.</para></listitem>
213 <term>dir_mode=<replaceable>arg</replaceable></term>
215 <listitem><para>If the server does not support the CIFS Unix extensions this
216 overrides the default mode for directories. </para></listitem>
220 <term>ip=<replaceable>arg</replaceable></term>
222 <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>
226 <term>domain=<replaceable>arg</replaceable></term>
228 <listitem><para>sets the domain (workgroup) of the user </para></listitem>
234 <listitem><para>don't prompt for a password </para></listitem>
239 <term>iocharset</term>
241 <listitem><para>Charset used to convert local path names to and from
242 Unicode. Unicode is used by default for network path
243 names if the server supports it. If iocharset is
244 not specified then the nls_default specified
245 during the local client kernel build will be used.
246 If server does not support Unicode, this parameter is
247 unused. </para></listitem>
254 <listitem><para>mount read-only</para></listitem>
260 <listitem><para>mount read-write</para></listitem>
265 <listitem><para>If the CIFS Unix extensions are negotiated with the server
266 the client will attempt to set the effective uid and gid of
267 the local process on newly created files, directories, and
268 devices (create, mkdir, mknod). If the CIFS Unix Extensions
269 are not negotiated, for newly created files and directories
270 instead of using the default uid and gid specified on the
271 the mount, cache the new file's uid and gid locally which means
272 that the uid for the file can change when the inode is
273 reloaded (or the user remounts the share).</para></listitem>
277 <term>nosetuids</term>
278 <listitem><para>The client will not attempt to set the uid and gid on
279 on newly created files, directories, and devices (create,
280 mkdir, mknod) which will result in the server setting the
281 uid and gid to the default (usually the server uid of the
282 user who mounted the share). Letting the server (rather than
283 the client) set the uid and gid is the default.If the CIFS
284 Unix Extensions are not negotiated then the uid and gid for
285 new files will appear to be the uid (gid) of the mounter or the
286 uid (gid) parameter specified on the mount.</para></listitem>
291 <listitem><para>Client does permission checks (vfs_permission check of uid
292 and gid of the file against the mode and desired operation),
293 Note that this is in addition to the normal ACL check on the
294 target machine done by the server software.
295 Client permission checking is enabled by default.</para></listitem>
300 <listitem><para>Client does not do permission checks. This can expose
301 files on this mount to access by other users on the local
302 client system. It is typically only needed when the server
303 supports the CIFS Unix Extensions but the UIDs/GIDs on the
304 client and server system do not match closely enough to allow
305 access by the user doing the mount.
306 Note that this does not affect the normal ACL check on the
307 target machine done by the server software (of the server
308 ACL against the user name provided at mount time).</para></listitem>
312 <term>directio</term>
313 <listitem><para>Do not do inode data caching on files opened on this mount.
314 This precludes mmaping files on this mount. In some cases
315 with fast networks and little or no caching benefits on the
316 client (e.g. when the application is doing large sequential
317 reads bigger than page size without rereading the same data)
318 this can provide better performance than the default
319 behavior which caches reads (readahead) and writes
320 (writebehind) through the local Linux client pagecache
321 if oplock (caching token) is granted and held. Note that
322 direct allows write operations larger than page size
323 to be sent to the server. On some kernels this requires the cifs.ko module
324 to be built with the CIFS_EXPERIMENTAL configure option.</para></listitem>
328 <term>mapchars</term>
329 <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)
330 to the remap range (above 0xF000), which also
331 allows the CIFS client to recognize files created with
332 such characters by Windows's POSIX emulation. This can
333 also be useful when mounting to most versions of Samba
334 (which also forbids creating and opening files
335 whose names contain any of these seven characters).
336 This has no effect if the server does not support
337 Unicode on the wire.</para></listitem>
341 <term>nomapchars</term>
342 <listitem><para>Do not translate any of these seven characters (default)</para></listitem>
347 <listitem><para>currently unimplemented</para></listitem>
352 <listitem><para>(default) currently unimplemented </para></listitem>
357 <listitem><para>The program accessing a file on the cifs mounted file system will hang when the
358 server crashes.</para></listitem>
363 <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>
368 <listitem><para>Do not allow POSIX ACL operations even if server would support them.</para><para>
369 The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
370 version 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and
371 then POSIX support in the CIFS configuration options when building the cifs
372 module. POSIX ACL support can be disabled on a per mount basic by specifying
373 "noacl" on mount.</para>
380 <para>Request case insensitive path name matching (case
381 sensitive is the default if the server suports it).
389 <para>Security mode. Allowed values are:</para>
391 <listitem><para>none attempt to connection as a null user (no name) </para></listitem>
392 <listitem><para>krb5 Use Kerberos version 5 authentication</para></listitem>
393 <listitem><para>krb5i Use Kerberos authentication and packet signing</para></listitem>
394 <listitem><para>ntlm Use NTLM password hashing (default)</para></listitem>
395 <listitem><para>ntlmi Use NTLM password hashing with signing (if
396 /proc/fs/cifs/PacketSigningEnabled on or if
397 server requires signing also can be the default)</para></listitem>
398 <listitem><para>ntlmv2 Use NTLMv2 password hashing</para></listitem>
399 <listitem><para>ntlmv2i Use NTLMv2 password hashing with packet signing</para></listitem>
402 <para>[NB This [sec parameter] is under development and expected to be available in cifs kernel module 1.40 and later]
410 <para>Do not send byte range lock requests to the server.
411 This is necessary for certain applications that break
412 with cifs style mandatory byte range locks (and most
413 cifs servers do not yet support requesting advisory
423 When the CIFS Unix Extensions are not negotiated, attempt to
424 create device files and fifos in a format compatible with
425 Services for Unix (SFU). In addition retrieve bits 10-12
426 of the mode via the SETFILEBITS extended attribute (as
427 SFU does). In the future the bottom 9 bits of the mode
428 mode also will be emulated using queries of the security
429 descriptor (ACL). [NB: requires version 1.39 or later
430 of the CIFS VFS. To recognize symlinks and be able
431 to create symlinks in an SFU interoperable form
432 requires version 1.40 or later of the CIFS VFS kernel module.
438 <term>serverino</term>
439 <listitem><para>Use inode numbers (unique persistent file identifiers)
440 returned by the server instead of automatically generating
441 temporary inode numbers on the client. Although server inode numbers
442 make it easier to spot hardlinked files (as they will have
443 the same inode numbers) and inode numbers may be persistent (which is
444 userful for some sofware),
445 the server does not guarantee that the inode numbers
446 are unique if multiple server side mounts are exported under a
447 single share (since inode numbers on the servers might not
448 be unique if multiple filesystems are mounted under the same
449 shared higher level directory). Note that not all
450 servers support returning server inode numbers, although
451 those that support the CIFS Unix Extensions, and Windows 2000 and
452 later servers typically do support this (although not necessarily
453 on every local server filesystem). Parameter has no effect if
454 the server lacks support for returning inode numbers or equivalent.
459 <term>noserverino</term>
460 <listitem><para>client generates inode numbers (rather than using the actual one
461 from the server) by default.
466 <term>nouser_xattr</term>
467 <listitem><para>(default) Do not allow getfattr/setfattr to get/set xattrs, even if server would support it otherwise. </para></listitem>
471 <term>rsize=<replaceable>arg</replaceable></term>
472 <listitem><para>default network read size (usually 16K). The client currently
473 can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize
474 defaults to 16K and may be changed (from 8K to the maximum
475 kmalloc size allowed by your kernel) at module install time
476 for cifs.ko. Setting CIFSMaxBufSize to a very large value
477 will cause cifs to use more memory and may reduce performance
478 in some cases. To use rsize greater than 127K (the original
479 cifs protocol maximum) also requires that the server support
480 a new Unix Capability flag (for very large read) which some
481 newer servers (e.g. Samba 3.0.26 or later) do. rsize can be
482 set from a minimum of 2048 to a maximum of 130048 (127K or
483 CIFSMaxBufSize, whichever is smaller)
489 <term>wsize=<replaceable>arg</replaceable></term>
491 <listitem><para>default network write size (default 57344)
492 maximum wsize currently allowed by CIFS is 57344 (fourteen
493 4096 byte pages)</para></listitem>
496 <term>--verbose</term>
497 <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>
505 <title>SERVICE FORMATTING AND DELIMITERS</title>
508 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.
511 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.
516 <title>ENVIRONMENT VARIABLES</title>
519 The variable <emphasis>USER</emphasis> may contain the username of the
520 person to be used to authenticate to the server.
521 The variable can be used to set both username and
522 password by using the format username%password.
526 The variable <emphasis>PASSWD</emphasis> may contain the password of the
527 person using the client.
531 The variable <emphasis>PASSWD_FILE</emphasis> may contain the pathname
532 of a file to read the password from. A single line of input is
533 read and used as the password.
541 <para>This command may be used only by root, unless installed setuid, in which case the noeexec and nosuid mount flags are enabled.</para>
545 <title>CONFIGURATION</title>
547 The primary mechanism for making configuration changes and for reading
548 debug information for the cifs vfs is via the Linux /proc filesystem.
549 In the directory <filename>/proc/fs/cifs</filename> are various
550 configuration files and pseudo files which can display debug information.
551 There are additional startup options such as maximum buffer size and number
552 of buffers which only may be set when the kernel cifs vfs (cifs.ko module) is
553 loaded. These can be seen by running the modinfo utility against the file
554 cifs.ko which will list the options that may be passed to cifs during module
555 installation (device driver load).
556 For more information see the kernel file <filename>fs/cifs/README</filename>.
563 <para>Mounting using the CIFS URL specification is currently not supported.
566 <para>The credentials file does not handle usernames or passwords with
567 leading space.</para>
570 Note that the typical response to a bug report is a suggestion
571 to try the latest version first. So please try doing that first,
572 and always include which versions you use of relevant software
573 when reporting bugs (minimum: mount.cifs (try mount.cifs -V), kernel (see /proc/version) and
574 server type you are trying to contact.
581 <title>VERSION</title>
583 <para>This man page is correct for version 1.52 of
584 the cifs vfs filesystem (roughly Linux kernel 2.6.24).</para>
588 <title>SEE ALSO</title>
590 Documentation/filesystems/cifs.txt and fs/cifs/README in the linux kernel
591 source tree may contain additional options and information.
593 <para><citerefentry><refentrytitle>umount.cifs</refentrytitle>
594 <manvolnum>8</manvolnum></citerefentry></para>
599 <title>AUTHOR</title>
601 <para>Steve French</para>
603 <para>The syntax and manpage were loosely based on that of smbmount. It
604 was converted to Docbook/XML by Jelmer Vernooij.</para>
606 <para>The maintainer of the Linux cifs vfs and the userspace
607 tool <emphasis>mount.cifs</emphasis> is <ulink url="mailto:sfrench@samba.org">Steve French</ulink>.
608 The <ulink url="mailto:linux-cifs-client@lists.samba.org">Linux CIFS Mailing list</ulink>
609 is the preferred place to ask questions regarding these programs.