| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>mount.cifs</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="mount.cifs.8"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>mount.cifs — mount using the Common Internet File System (CIFS)</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="literal">mount.cifs</code> {service} {mount-point} [-o options]</p></div></div><div class="refsect1" lang="en"><a name="id2522954"></a><h2>DESCRIPTION</h2><p>This tool is part of the <a class="citerefentry" href="samba.7.html"><span class="citerefentry"><span class="refentrytitle">samba</span>(7)</span></a> suite.</p><p>mount.cifs mounts a Linux CIFS filesystem. It
|
|---|
| 2 | is usually invoked indirectly by
|
|---|
| 3 | the <a class="citerefentry" href="mount.8.html"><span class="citerefentry"><span class="refentrytitle">mount</span>(8)</span></a> command when using the
|
|---|
| 4 | "-t cifs" option. This command only works in Linux, and the kernel must
|
|---|
| 5 | support the cifs filesystem. The CIFS protocol is the successor to the
|
|---|
| 6 | SMB protocol and is supported by most Windows servers and many other
|
|---|
| 7 | commercial servers and Network Attached Storage appliances as well as
|
|---|
| 8 | by the popular Open Source server Samba.
|
|---|
| 9 | </p><p>
|
|---|
| 10 | The mount.cifs utility attaches the UNC name (exported network resource)
|
|---|
| 11 | specified as <span class="emphasis"><em>service</em></span> (using //server/share syntax,
|
|---|
| 12 | where "server" is the server name or IP address and "share" is the name
|
|---|
| 13 | of the share) to the local directory <span class="emphasis"><em>mount-point</em></span>.
|
|---|
| 14 | It is possible to set the mode for mount.cifs to setuid root to allow
|
|---|
| 15 | non-root users to mount shares to directories for which they
|
|---|
| 16 | have write permission.
|
|---|
| 17 | </p><p>
|
|---|
| 18 | Options to <span class="emphasis"><em>mount.cifs</em></span> are specified as a comma-separated
|
|---|
| 19 | list of key=value pairs. It is possible to send options other
|
|---|
| 20 | than those listed here, assuming that the cifs filesystem kernel module (cifs.ko) supports them.
|
|---|
| 21 | Unrecognized cifs mount options passed to the cifs vfs kernel code will be logged to the
|
|---|
| 22 | kernel log.
|
|---|
| 23 |
|
|---|
| 24 | </p><p><span class="emphasis"><em>mount.cifs</em></span> causes the cifs vfs to launch a thread named cifsd. After mounting it keeps running until
|
|---|
| 25 | the mounted resource is unmounted (usually via the umount utility).
|
|---|
| 26 | </p></div><div class="refsect1" lang="en"><a name="id2483399"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">user=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>specifies the username to connect as. If
|
|---|
| 27 | this is not given, then the environment variable <span class="emphasis"><em>USER</em></span> is used. This option can also take the
|
|---|
| 28 | form "user%password" or "workgroup/user" or
|
|---|
| 29 | "workgroup/user%password" to allow the password and workgroup
|
|---|
| 30 | to be specified as part of the username.
|
|---|
| 31 | </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
|---|
| 32 | The cifs vfs accepts the parameter <em class="parameter"><code>user=</code></em>, or for users familiar with smbfs it accepts the longer form of the parameter <em class="parameter"><code>username=</code></em>. Similarly the longer smbfs style parameter names may be accepted as synonyms for the shorter cifs parameters <em class="parameter"><code>pass=</code></em>,<em class="parameter"><code>dom=</code></em> and <em class="parameter"><code>cred=</code></em>.
|
|---|
| 33 | </p></div></dd><dt><span class="term">password=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>specifies the CIFS password. If this
|
|---|
| 34 | option is not given then the environment variable
|
|---|
| 35 | <span class="emphasis"><em>PASSWD</em></span> is used. If the password is not specified
|
|---|
| 36 | directly or indirectly via an argument to mount, <span class="emphasis"><em>mount.cifs</em></span> will prompt
|
|---|
| 37 | for a password, unless the guest option is specified.
|
|---|
| 38 | </p><p>Note that a password which contains the delimiter
|
|---|
| 39 | character (i.e. a comma ',') will fail to be parsed correctly
|
|---|
| 40 | on the command line. However, the same password defined
|
|---|
| 41 | in the PASSWD environment variable or via a credentials file (see
|
|---|
| 42 | below) or entered at the password prompt will be read correctly.
|
|---|
| 43 | </p></dd><dt><span class="term">credentials=<em class="replaceable"><code>filename</code></em></span></dt><dd><p>
|
|---|
| 44 | specifies a file that contains a username
|
|---|
| 45 | and/or password and optionally the name of the
|
|---|
| 46 | workgroup. The format of the file is:
|
|---|
| 47 | </p><pre class="programlisting">
|
|---|
| 48 | username=<em class="replaceable"><code>value</code></em>
|
|---|
| 49 | password=<em class="replaceable"><code>value</code></em>
|
|---|
| 50 | workgroup=<em class="replaceable"><code>value</code></em>
|
|---|
| 51 | </pre><p>
|
|---|
| 52 | This is preferred over having passwords in plaintext in a
|
|---|
| 53 | shared file, such as <code class="filename">/etc/fstab</code>. Be sure to protect any
|
|---|
| 54 | credentials file properly.
|
|---|
| 55 | </p></dd><dt><span class="term">uid=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>sets the uid that will own all files on
|
|---|
| 56 | the mounted filesystem.
|
|---|
| 57 | It may be specified as either a username or a numeric uid.
|
|---|
| 58 | For mounts to servers which do support the CIFS Unix extensions,
|
|---|
| 59 | such as a properly configured Samba server, the server provides
|
|---|
| 60 | the uid, gid and mode so this parameter should not be
|
|---|
| 61 | specified unless the server and client uid and gid
|
|---|
| 62 | numbering differ. If the server and client are in the
|
|---|
| 63 | same domain (e.g. running winbind or nss_ldap) and
|
|---|
| 64 | the server supports the Unix Extensions then the uid
|
|---|
| 65 | and gid can be retrieved from the server (and uid
|
|---|
| 66 | and gid would not have to be specified on the mount.
|
|---|
| 67 | For servers which do not support the CIFS Unix
|
|---|
| 68 | extensions, the default uid (and gid) returned on lookup
|
|---|
| 69 | of existing files will be the uid (gid) of the person
|
|---|
| 70 | who executed the mount (root, except when mount.cifs
|
|---|
| 71 | is configured setuid for user mounts) unless the "uid="
|
|---|
| 72 | (gid) mount option is specified. For the uid (gid) of newly
|
|---|
| 73 | created files and directories, ie files created since
|
|---|
| 74 | the last mount of the server share, the expected uid
|
|---|
| 75 | (gid) is cached as long as the inode remains in
|
|---|
| 76 | memory on the client. Also note that permission
|
|---|
| 77 | checks (authorization checks) on accesses to a file occur
|
|---|
| 78 | at the server, but there are cases in which an administrator
|
|---|
| 79 | may want to restrict at the client as well. For those
|
|---|
| 80 | servers which do not report a uid/gid owner
|
|---|
| 81 | (such as Windows), permissions can also be checked at the
|
|---|
| 82 | client, and a crude form of client side permission checking
|
|---|
| 83 | can be enabled by specifying file_mode and dir_mode on
|
|---|
| 84 | the client. Note that the mount.cifs helper must be
|
|---|
| 85 | at version 1.10 or higher to support specifying the uid
|
|---|
| 86 | (or gid) in non-numeric form.
|
|---|
| 87 | </p></dd><dt><span class="term">gid=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>sets the gid that will own all files on
|
|---|
| 88 | the mounted filesystem. It may be specified as either a groupname or a numeric
|
|---|
| 89 | gid. For other considerations see the description of uid above.
|
|---|
| 90 | </p></dd><dt><span class="term">port=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>sets the port number on the server to attempt to contact to negotiate
|
|---|
| 91 | CIFS support. If the CIFS server is not listening on this port or
|
|---|
| 92 | if it is not specified, the default ports will be tried i.e.
|
|---|
| 93 | port 445 is tried and if no response then port 139 is tried.
|
|---|
| 94 | </p></dd><dt><span class="term">servern=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>
|
|---|
| 95 | Specify the server netbios name (RFC1001 name) to use
|
|---|
| 96 | when attempting to setup a session to the server. Although
|
|---|
| 97 | rarely needed for mounting to newer servers, this option
|
|---|
| 98 | is needed for mounting to some older servers (such
|
|---|
| 99 | as OS/2 or Windows 98 and Windows ME) since when connecting
|
|---|
| 100 | over port 139 they, unlike most newer servers, do not
|
|---|
| 101 | support a default server name. A server name can be up
|
|---|
| 102 | to 15 characters long and is usually uppercased.
|
|---|
| 103 | </p></dd><dt><span class="term">netbiosname=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>When mounting to servers via port 139, specifies the RFC1001
|
|---|
| 104 | source name to use to represent the client netbios machine
|
|---|
| 105 | name when doing the RFC1001 netbios session initialize.
|
|---|
| 106 | </p></dd><dt><span class="term">file_mode=<em class="replaceable"><code>arg</code></em></span></dt><dd><p>If the server does not support the CIFS Unix extensions this
|
|---|
|
|---|