s3-printing: an empty cups printer list is treated as an error
[Samba.git] / docs-xml / manpages-3 / mount.cifs.8.xml
blobdb6028e262f1025940860601f5cec70788a98366
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">
5 <refmeta>
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.4</refmiscinfo>
11 </refmeta>
14 <refnamediv>
15         <refname>mount.cifs</refname>
16         <refpurpose>mount using the Common Internet File System (CIFS)</refpurpose>
17 </refnamediv>
19 <refsynopsisdiv>
20         <cmdsynopsis>
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>      
26         </cmdsynopsis>
27 </refsynopsisdiv>
29 <refsect1>
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.
43         </para>
45         <para>
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.
53         </para>
55         <para>
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
60 kernel log.
62         </para>
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).
66         </para>
68         <para>
69                 <emphasis>mount.cifs -V</emphasis> command displays the version of cifs mount helper.
70         </para>
71         <para>
73                 <emphasis>modinfo cifs</emphasis> command displays the version of cifs module.
74         </para>
76 </refsect1>
78 <refsect1>
79         <title>OPTIONS</title>
80         <variablelist>
81                 <varlistentry><term>user=<replaceable>arg</replaceable></term>
83                 <listitem><para>specifies the username to connect as. If
84                                 this is not given, then the environment variable <emphasis>USER</emphasis> is used. This option can also take the
85 form "user%password" or "workgroup/user" or
86 "workgroup/user%password" to allow the password and workgroup
87 to be specified as part of the username.
88                 </para>
90 <note>
91         <para>
92         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>.
93         </para>
94 </note>
96                 </listitem>
97         </varlistentry>
99         <varlistentry><term>password=<replaceable>arg</replaceable></term>
101                 <listitem><para>specifies the CIFS password. If this
102 option is not given then the environment variable
103 <emphasis>PASSWD</emphasis> is used. If the password is not specified
104 directly or indirectly via an argument to mount, <emphasis>mount.cifs</emphasis> will prompt
105 for a password, unless the guest option is specified.
106 </para>
108 <para>Note that a password which contains the delimiter
109 character (i.e. a comma ',') will fail to be parsed correctly
110 on the command line.  However, the same password defined
111 in the PASSWD environment variable or via a credentials file (see
112 below) or entered at the password prompt will be read correctly.
113 </para>
114         </listitem></varlistentry>
116         <varlistentry><term>credentials=<replaceable>filename</replaceable></term>
118                 <listitem><para>
119                                 specifies a file that contains a username
120                                 and/or password and optionally the name of the
121                                 workgroup. The format of the file is:
122                         </para>
124 <programlisting>
125                 username=<replaceable>value</replaceable>
126                 password=<replaceable>value</replaceable>
127                 domain=<replaceable>value</replaceable>
128 </programlisting>
130                 <para>
131 This is preferred over having passwords in plaintext in a
132 shared file, such as <filename>/etc/fstab</filename>. Be sure to protect any
133 credentials file properly.
134                 </para>
135         </listitem></varlistentry>
137         <varlistentry>
138                 <term>uid=<replaceable>arg</replaceable></term>
140                 <listitem><para>sets the uid that will own all files on
141         the mounted filesystem.
142         It may be specified as either a username or a numeric uid.
143         For mounts to servers which do support the CIFS Unix extensions, 
144         such as a properly configured Samba server, the server provides
145                 the uid, gid and mode so this parameter should not be
146                 specified unless the server and client uid and gid
147                 numbering differ.  If the server and client are in the
148                 same domain (e.g. running winbind or nss_ldap) and
149                 the server supports the Unix Extensions then the uid
150                 and gid can be retrieved from the server (and uid
151                 and gid would not have to be specified on the mount.
152                 For servers which do not support the CIFS Unix
153                 extensions, the default uid (and gid) returned on lookup 
154                 of existing files will be the uid (gid) of the person
155                 who executed the mount (root, except when mount.cifs
156                 is configured setuid for user mounts) unless the "uid="
157                 (gid) mount option is specified.  For the uid (gid) of newly
158                 created files and directories, ie files created since
159                 the last mount of the server share, the expected uid
160                 (gid) is cached as long as the inode remains in
161                 memory on the client.   Also note that permission
162                 checks (authorization checks) on accesses to a file occur
163                 at the server, but there are cases in which an administrator
164                 may want to restrict at the client as well.  For those
165                 servers which do not report a uid/gid owner
166                 (such as Windows), permissions can also be checked at the
167                 client, and a crude form of client side permission checking
168                 can be enabled by specifying file_mode and dir_mode on
169                 the client.  Note that the mount.cifs helper must be
170                 at version 1.10 or higher to support specifying the uid
171                 (or gid) in non-numeric form.
172         </para></listitem>
173         </varlistentry>
175         <varlistentry>
176                 <term>gid=<replaceable>arg</replaceable></term>
178                 <listitem><para>sets the gid that will own all files on
179 the mounted filesystem.  It may be specified as either a groupname or a numeric 
180 gid. For other considerations see the description of uid above. 
181                 </para></listitem>
182         </varlistentry>
184         <varlistentry>
185                 <term>port=<replaceable>arg</replaceable></term>
187                 <listitem><para>sets the port number on the server to attempt to contact to negotiate
188 CIFS support.  If the CIFS server is not listening on this port or
189 if it is not specified, the default ports will be tried i.e. 
190 port 445 is tried and if no response then port 139 is tried.
191                 </para></listitem>
192         </varlistentry>
194         <varlistentry>
195                 <term>servern=<replaceable>arg</replaceable></term>
197                 <listitem><para>
198                 Specify the server netbios name (RFC1001 name) to use
199                 when attempting to setup a session to the server. Although
200                 rarely needed for mounting to newer servers, this option
201                 is needed for mounting to some older servers (such
202                 as OS/2 or Windows 98 and Windows ME) since when connecting
203                 over port 139 they, unlike most newer servers, do not
204                 support a default server name.  A server name can be up
205                 to 15 characters long and is usually uppercased.
206                 </para></listitem>
207         </varlistentry>
209         <varlistentry>
210                 <term>netbiosname=<replaceable>arg</replaceable></term>
212                 <listitem><para>When mounting to servers via port 139, specifies the RFC1001
213                 source name to use to represent the client netbios machine
214                 name when doing the RFC1001 netbios session initialize.
215                 </para></listitem>
216         </varlistentry>
218         <varlistentry>
219                 <term>file_mode=<replaceable>arg</replaceable></term>
221                 <listitem><para>If the server does not support the CIFS Unix extensions this
222                                 overrides the default file mode.</para></listitem>
223         </varlistentry>
225         <varlistentry>
226                 <term>dir_mode=<replaceable>arg</replaceable></term>
228                 <listitem><para>If the server does not support the CIFS Unix extensions this
229                                 overrides the default mode for directories. </para></listitem>
230         </varlistentry>
232         <varlistentry>
233                 <term>ip=<replaceable>arg</replaceable></term>
235                 <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>
236         </varlistentry>
238         <varlistentry>
239                 <term>domain=<replaceable>arg</replaceable></term>
241                 <listitem><para>sets the domain (workgroup) of the user </para></listitem>
242         </varlistentry>
244         <varlistentry>
245                 <term>guest</term>
247                 <listitem><para>don't prompt for a password </para></listitem>
249         </varlistentry>
251         <varlistentry>
252                 <term>iocharset</term>
254                 <listitem><para>Charset used to convert local path names to and from
255                 Unicode. Unicode is used by default for network path
256                 names if the server supports it. If iocharset is
257                 not specified then the nls_default specified
258                 during the local client kernel build will be used.
259                 If server does not support Unicode, this parameter is
260                 unused. </para></listitem>
262         </varlistentry>
264         <varlistentry>
265                 <term>ro</term>
267                 <listitem><para>mount read-only</para></listitem>
269         </varlistentry>
271         <varlistentry>
272                 <term>rw</term>
273                 <listitem><para>mount read-write</para></listitem>
274         </varlistentry>
276         <varlistentry>
277                 <term>setuids</term>
278                 <listitem><para>If the CIFS Unix extensions are negotiated with the server
279                 the client will attempt to set the effective uid and gid of
280                 the local process on newly created files, directories, and
281                 devices (create, mkdir, mknod). If the CIFS Unix Extensions
282                 are not negotiated, for newly created files and directories
283                 instead of using the default uid and gid specified on the
284                 the mount, cache the new file's uid and gid locally which means
285                 that the uid for the file can change when the inode is
286                 reloaded (or the user remounts the share).</para></listitem>
287         </varlistentry>
289         <varlistentry>
290                 <term>nosetuids</term>
291                 <listitem><para>The client will not attempt to set the uid and gid on
292                 on newly created files, directories, and devices (create,
293                 mkdir, mknod) which will result in the server setting the
294                 uid and gid to the default (usually the server uid of the
295                 user who mounted the share).  Letting the server (rather than
296                 the client) set the uid and gid is the default.If the CIFS
297                 Unix Extensions are not negotiated then the uid and gid for
298                 new files will appear to be the uid (gid) of the mounter or the
299                 uid (gid) parameter specified on the mount.</para></listitem>
300         </varlistentry>
302         <varlistentry>
303                 <term>perm</term>
304                 <listitem><para>Client does permission checks (vfs_permission check of uid
305                 and gid of the file against the mode and desired operation),
306                 Note that this is in addition to the normal ACL check on the
307                 target machine done by the server software.
308                 Client permission checking is enabled by default.</para></listitem>
309         </varlistentry>
311         <varlistentry>
312                 <term>noperm</term>
313                 <listitem><para>Client does not do permission checks.  This can expose
314                 files on this mount to access by other users on the local
315                 client system. It is typically only needed when the server
316                 supports the CIFS Unix Extensions but the UIDs/GIDs on the
317                 client and server system do not match closely enough to allow
318                 access by the user doing the mount.
319                 Note that this does not affect the normal ACL check on the
320                 target machine done by the server software (of the server
321                 ACL against the user name provided at mount time).</para></listitem>
322         </varlistentry>
324         <varlistentry>
325                 <term>directio</term>
326                 <listitem><para>Do not do inode data caching on files opened on this mount.
327                 This precludes mmaping files on this mount. In some cases
328                 with fast networks and little or no caching benefits on the
329                 client (e.g. when the application is doing large sequential
330                 reads bigger than page size without rereading the same data)
331                 this can provide better performance than the default
332                 behavior which caches reads (readahead) and writes
333                 (writebehind) through the local Linux client pagecache
334                 if oplock (caching token) is granted and held. Note that
335                 direct allows write operations larger than page size
336                 to be sent to the server. On some kernels this requires the cifs.ko module
337                 to be built with the CIFS_EXPERIMENTAL configure option.</para></listitem>
338         </varlistentry>
340         <varlistentry>
341                 <term>mapchars</term>
342                 <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)
343                 to the remap range (above 0xF000), which also
344                 allows the CIFS client to recognize files created with
345                 such characters by Windows's POSIX emulation. This can
346                 also be useful when mounting to most versions of Samba
347                 (which also forbids creating and opening files
348                 whose names contain any of these seven characters).
349                 This has no effect if the server does not support
350                 Unicode on the wire.</para></listitem>
351         </varlistentry>
353         <varlistentry>
354                 <term>nomapchars</term>
355                 <listitem><para>Do not translate any of these seven characters (default)</para></listitem>
356         </varlistentry>
358         <varlistentry>
359                 <term>intr</term>
360                 <listitem><para>currently unimplemented</para></listitem>
361         </varlistentry>
363         <varlistentry>
364                 <term>nointr</term>
365                 <listitem><para>(default) currently unimplemented </para></listitem>
366         </varlistentry>
368         <varlistentry>
369                 <term>hard</term>
370                 <listitem><para>The  program  accessing  a file on the cifs mounted file system will hang when the
371               server crashes.</para></listitem>
372         </varlistentry>
374         <varlistentry>
375                 <term>soft</term>
376                 <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>
377         </varlistentry>
379         <varlistentry>
380                 <term>noacl</term>
381                 <listitem><para>Do not allow POSIX ACL operations even if server would support them.</para><para>
382                 The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
383                 version 3.0.10 and later.  Setting POSIX ACLs requires enabling both XATTR and
384                 then POSIX support in the CIFS configuration options when building the cifs
385                 module.  POSIX ACL support can be disabled on a per mount basis by specifying
386                 "noacl" on mount.</para>
387                 </listitem>
388         </varlistentry>
390         <varlistentry>
391                 <term>nocase</term>
392                 <listitem>
393                 <para>Request case insensitive path name matching (case
394                 sensitive is the default if the server suports it).
395                 </para>
396                 </listitem>
397         </varlistentry>
399         <varlistentry>
400                 <term>sec=</term>
401                 <listitem>
402                 <para>Security mode.  Allowed values are:</para>
403                         <itemizedlist>
404                         <listitem><para>none    attempt to connection as a null user (no name) </para></listitem>
405                         <listitem><para>krb5    Use Kerberos version 5 authentication</para></listitem>
406                         <listitem><para>krb5i   Use Kerberos authentication and packet signing</para></listitem>
407                         <listitem><para>ntlm    Use NTLM password hashing (default)</para></listitem>
408                         <listitem><para>ntlmi   Use NTLM password hashing with signing (if
409                                 /proc/fs/cifs/PacketSigningEnabled on or if
410                                 server requires signing also can be the default)</para></listitem>
411                         <listitem><para>ntlmv2  Use NTLMv2 password hashing</para></listitem>
412                         <listitem><para>ntlmv2i Use NTLMv2 password hashing with packet signing</para></listitem>
413                         </itemizedlist>
415                         <para>[NB This [sec parameter] is under development and expected to be available in cifs kernel module 1.40 and later]
416                 </para>
417                 </listitem>
418         </varlistentry>
420         <varlistentry>
421                 <term>nobrl</term>
422                 <listitem>
423                 <para>Do not send byte range lock requests to the server.
424                 This is necessary for certain applications that break
425                 with cifs style mandatory byte range locks (and most
426                 cifs servers do not yet support requesting advisory
427                 byte range locks).
428                 </para>
429                 </listitem>
430         </varlistentry>
432         <varlistentry>
433                 <term>sfu</term>
434                 <listitem>
435                 <para>
436                 When the CIFS Unix Extensions are not negotiated, attempt to
437                 create device files and fifos in a format compatible with
438                 Services for Unix (SFU).  In addition retrieve bits 10-12
439                 of the mode via the SETFILEBITS extended attribute (as
440                 SFU does).  In the future the bottom 9 bits of the mode
441                 mode also will be emulated using queries of the security
442                 descriptor (ACL). [NB: requires version 1.39 or later
443                 of the CIFS VFS.  To recognize symlinks and be able
444                 to create symlinks in an SFU interoperable form
445                 requires version 1.40 or later of the CIFS VFS kernel module.
446                 </para>
447                 </listitem>
448         </varlistentry>
450         <varlistentry>
451                 <term>serverino</term>
452                 <listitem><para>Use inode numbers (unique persistent file identifiers)
453                 returned by the server instead of automatically generating
454                 temporary inode numbers on the client.  Although server inode numbers
455                 make it easier to spot hardlinked files (as they will have
456                 the same inode numbers) and inode numbers may be persistent (which is
457                 userful for some sofware),
458                 the server does not guarantee that the inode numbers
459                 are unique if multiple server side mounts are exported under a
460                 single share (since inode numbers on the servers might not
461                 be unique if multiple filesystems are mounted under the same
462                 shared higher level directory).  Note that not all 
463                 servers support returning server inode numbers, although
464                 those that support the CIFS Unix Extensions, and Windows 2000 and
465                 later servers typically do support this (although not necessarily
466                 on every local server filesystem). Parameter has no effect if
467                 the server lacks support for returning inode numbers or equivalent.
468                 </para></listitem>
469         </varlistentry>
471         <varlistentry>
472                 <term>noserverino</term>
473                 <listitem><para>client generates inode numbers (rather than using the actual one
474                 from the server) by default.
475                 </para></listitem>
476         </varlistentry>
478         <varlistentry>
479                 <term>nouser_xattr</term>
480                 <listitem><para>(default) Do not allow getfattr/setfattr to get/set xattrs, even if server would support it otherwise. </para></listitem>
481         </varlistentry>
483         <varlistentry>
484                 <term>rsize=<replaceable>arg</replaceable></term>
485                 <listitem><para>default network read size (usually 16K). The client currently
486                 can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize
487                 defaults to 16K and may be changed (from 8K to the maximum
488                 kmalloc size allowed by your kernel) at module install time
489                 for cifs.ko. Setting CIFSMaxBufSize to a very large value
490                 will cause cifs to use more memory and may reduce performance
491                 in some cases.  To use rsize greater than 127K (the original
492                 cifs protocol maximum) also requires that the server support
493                 a new Unix Capability flag (for very large read) which some
494                 newer servers (e.g. Samba 3.0.26 or later) do. rsize can be
495                 set from a minimum of 2048 to a maximum of 130048 (127K or
496                 CIFSMaxBufSize, whichever is smaller)
498                 </para></listitem>
499         </varlistentry>
501         <varlistentry>
502                 <term>wsize=<replaceable>arg</replaceable></term>
504                 <listitem><para>default network write size (default 57344)
505                 maximum wsize currently allowed by CIFS is 57344 (fourteen
506                 4096 byte pages)</para></listitem>
507         </varlistentry>
508          <varlistentry>
509                 <term>--verbose</term>
510                 <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>
511         </varlistentry>
514         </variablelist>
515 </refsect1>
517 <refsect1>
518         <title>SERVICE FORMATTING AND DELIMITERS</title>
520         <para>
521                 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.
522         </para>
523         <para>
524                 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.
525         </para>
526 </refsect1>
528 <refsect1>
529         <title>ENVIRONMENT VARIABLES</title>
531         <para>
532                 The variable <emphasis>USER</emphasis> may contain the username of the
533 person to be used to authenticate to the server.
534 The variable can be used to set both username and
535 password by using the format username%password.
536         </para>
537         
538         <para>
539                 The variable <emphasis>PASSWD</emphasis> may contain the password of the
540 person using the client.
541         </para>
543         <para>
544                 The variable <emphasis>PASSWD_FILE</emphasis> may contain the pathname
545 of a file to read the password from. A single line of input is
546 read and used as the password.
547         </para>
549 </refsect1>
551 <refsect1>
552         <title>NOTES</title>
553         
554         <para>This command may be used only by root, unless installed setuid, in which case the noeexec and nosuid mount flags are enabled.</para>
555 </refsect1>
557 <refsect1>
558         <title>CONFIGURATION</title>
559                 <para>
560 The primary mechanism for making configuration changes and for reading 
561 debug information for the cifs vfs is via the Linux /proc filesystem.
562 In the directory <filename>/proc/fs/cifs</filename> are various 
563 configuration files and pseudo files which can display debug information.  
564 There are additional startup options such as maximum buffer size and number
565 of buffers which only may be set when the kernel cifs vfs (cifs.ko module) is 
566 loaded.  These can be seen by running the modinfo utility against the file
567 cifs.ko which will list the options that may be passed to cifs during module
568 installation (device driver load).
569 For more information see the kernel file <filename>fs/cifs/README</filename>.
570 </para>
571 </refsect1>
573 <refsect1>
574         <title>BUGS</title>
576         <para>Mounting using the CIFS URL specification is currently not supported.
577         </para>
579         <para>The credentials file does not handle usernames or passwords with
580                 leading space.</para>
582         <para>
583 Note that the typical response to a bug report is a suggestion
584 to try the latest version first. So please try doing that first,
585 and always include which versions you use of relevant software
586 when reporting bugs (minimum: mount.cifs (try mount.cifs -V), kernel (see /proc/version) and
587 server type you are trying to contact.
588 </para>
589 </refsect1>
593 <refsect1>
594         <title>VERSION</title>
596         <para>This man page is correct for version 1.52 of 
597         the cifs vfs filesystem (roughly Linux kernel 2.6.24).</para>
598 </refsect1>
600 <refsect1>
601         <title>SEE ALSO</title>
602         <para>
603         Documentation/filesystems/cifs.txt and fs/cifs/README in the linux kernel
604         source tree may contain additional options and information.
605 </para>
606         <para><citerefentry><refentrytitle>umount.cifs</refentrytitle>
607         <manvolnum>8</manvolnum></citerefentry></para>
609 </refsect1>
611 <refsect1>
612         <title>AUTHOR</title>
613         
614         <para>Steve French</para>
616         <para>The syntax and manpage were loosely based on that of smbmount. It 
617                 was converted to Docbook/XML by Jelmer Vernooij.</para>
619         <para>The maintainer of the Linux cifs vfs and the userspace
620                 tool <emphasis>mount.cifs</emphasis> is <ulink url="mailto:sfrench@samba.org">Steve French</ulink>.
621                 The <ulink url="mailto:linux-cifs-client@lists.samba.org">Linux CIFS Mailing list</ulink> 
622                 is the preferred place to ask questions regarding these programs. 
623         </para>
625 </refsect1>
627 </refentry>