Blame mount.cifs.rst

Packit Service 09cdfc
==========
Packit Service 09cdfc
mount.cifs
Packit Service 09cdfc
==========
Packit Service 09cdfc
Packit Service 09cdfc
--------------------------------------------------
Packit Service 09cdfc
mount using the Common Internet File System (CIFS)
Packit Service 09cdfc
--------------------------------------------------
Packit Service 09cdfc
:Manual section: 8
Packit Service 09cdfc
Packit Service 09cdfc
********
Packit Service 09cdfc
SYNOPSIS
Packit Service 09cdfc
********
Packit Service 09cdfc
Packit Service 09cdfc
  mount.cifs {service} {mount-point} [-o options]
Packit Service 09cdfc
Packit Service 09cdfc
This tool is part of the cifs-utils suite.
Packit Service 09cdfc
Packit Service 09cdfc
``mount.cifs`` mounts a Linux CIFS filesystem. It is usually invoked
Packit Service 09cdfc
indirectly by the mount(8) command when using the "-t cifs"
Packit Service 09cdfc
option. This command only works in Linux, and the kernel must support
Packit Service 09cdfc
the cifs filesystem. The CIFS protocol is the successor to the SMB
Packit Service 09cdfc
protocol and is supported by most Windows servers and many other
Packit Service 09cdfc
commercial servers and Network Attached Storage appliances as well as
Packit Service 09cdfc
by the popular Open Source server Samba.
Packit Service 09cdfc
Packit Service 09cdfc
The mount.cifs utility attaches the UNC name (exported network
Packit Service 09cdfc
resource) specified as service (using ``//server/share`` syntax, where
Packit Service 09cdfc
"server" is the server name or IP address and "share" is the name of
Packit Service 09cdfc
the share) to the local directory mount-point.
Packit Service 09cdfc
Packit Service 09cdfc
Options to mount.cifs are specified as a comma-separated list of
Packit Service 09cdfc
``key=value`` pairs. It is possible to send options other than those
Packit Service 09cdfc
listed here, assuming that the cifs filesystem kernel module
Packit Service 09cdfc
(``cifs.ko``) supports them. Unrecognized cifs mount options passed to
Packit Service 09cdfc
the cifs vfs kernel code will be logged to the kernel log.
Packit Service 09cdfc
Packit Service 09cdfc
``mount.cifs`` causes the cifs vfs to launch a thread named
Packit Service 09cdfc
cifsd. After mounting it keeps running until the mounted resource is
Packit Service 09cdfc
unmounted (usually via the ``umount`` utility).
Packit Service 09cdfc
Packit Service 09cdfc
``mount.cifs -V`` command displays the version of cifs mount helper.
Packit Service 09cdfc
Packit Service 09cdfc
``modinfo cifs`` command displays the version of cifs module.
Packit Service 09cdfc
Packit Service 09cdfc
Packit Service 09cdfc
*******
Packit Service 09cdfc
OPTIONS
Packit Service 09cdfc
*******
Packit Service 09cdfc
Packit Service 09cdfc
username=arg|user=arg
Packit Service 09cdfc
  specifies the username to connect as. If this is not
Packit Service 09cdfc
  given, then the environment variable USER is used.
Packit Service 09cdfc
Packit Service 09cdfc
  Earlier versions of mount.cifs also allowed one to specify the
Packit Service 09cdfc
  username in a ``user%password`` or ``workgroup/user`` or
Packit Service 09cdfc
  ``workgroup/user%password`` to allow the password and workgroup to
Packit Service 09cdfc
  be specified as part of the username. Support for those alternate
Packit Service 09cdfc
  username formats is now deprecated and should no longer be
Packit Service 09cdfc
  used. Users should use the discrete ``password=`` and ``domain=`` to
Packit Service 09cdfc
  specify those values. While some versions of the cifs kernel module
Packit Service 09cdfc
  accept ``user=`` as an abbreviation for this option, its use can
Packit Service 09cdfc
  confuse the standard mount program into thinking that this is a
Packit Service 09cdfc
  non-superuser mount. It is therefore recommended to use the full
Packit Service 09cdfc
  ``username=`` option name.
Packit Service 09cdfc
Packit Service 09cdfc
password=arg|pass=arg
Packit Service 09cdfc
  specifies the CIFS password. If this option is not given then the
Packit Service 09cdfc
  environment variable PASSWD is used. If the password is not specified
Packit Service 09cdfc
  directly or indirectly via an argument to mount, mount.cifs will
Packit Service 09cdfc
  prompt for a password, unless the guest option is specified.
Packit Service 09cdfc
Packit Service 09cdfc
  Note that a password which contains the delimiter character (i.e. a
Packit Service 09cdfc
  comma ',') will fail to be parsed correctly on the command
Packit Service 09cdfc
  line. However, the same password defined in the PASSWD environment
Packit Service 09cdfc
  variable or via a credentials file (see below) or entered at the
Packit Service 09cdfc
  password prompt will be read correctly.
Packit Service 09cdfc
Packit Service 09cdfc
credentials=filename|cred=filename
Packit Service 09cdfc
  specifies a file that contains a username and/or password and
Packit Service 09cdfc
  optionally the name of the workgroup. The format of the file is::
Packit Service 09cdfc
Packit Service 09cdfc
   username=value
Packit Service 09cdfc
   password=value
Packit Service 09cdfc
   domain=value
Packit Service 09cdfc
Packit Service 664a73
  This is preferred over having passwords in plaintext in a shared file,
Packit Service 664a73
  such as */etc/fstab* . Be sure to protect any credentials file
Packit Service 664a73
  properly.
Packit Service 09cdfc
Packit Service 09cdfc
uid=arg
Packit Service 09cdfc
  sets the uid that will own all files or directories on the mounted
Packit Service 09cdfc
  filesystem when the server does not provide ownership information. It
Packit Service 09cdfc
  may be specified as either a username or a numeric uid. When not
Packit Service 09cdfc
  specified, the default is uid 0. The mount.cifs helper must be at
Packit Service 09cdfc
  version 1.10 or higher to support specifying the uid in non-numeric
Packit Service 09cdfc
  form. See the section on `FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS`_
Packit Service 09cdfc
  below for more information.
Packit Service 09cdfc
Packit Service 09cdfc
forceuid
Packit Service 09cdfc
  instructs the client to ignore any uid provided by the server for
Packit Service 09cdfc
  files and directories and to always assign the owner to be the value
Packit Service 09cdfc
  of the uid= option. See the section on
Packit Service 09cdfc
  `FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS`_ below for more information.
Packit Service 09cdfc
Packit Service 09cdfc
cruid=arg
Packit Service 09cdfc
  sets the uid of the owner of the credentials cache. This is primarily
Packit Service 09cdfc
  useful with ``sec=krb5``. The default is the real uid of the process
Packit Service 09cdfc
  performing the mount. Setting this parameter directs the upcall to
Packit Service 09cdfc
  look for a credentials cache owned by that user.
Packit Service 09cdfc
Packit Service 09cdfc
gid=arg
Packit Service 09cdfc
  sets the gid that will own all files or directories on the mounted
Packit Service 09cdfc
  filesystem when the server does not provide ownership information. It
Packit Service 09cdfc
  may be specified as either a groupname or a numeric gid. When not
Packit Service 09cdfc
  specified, the default is gid 0. The mount.cifs helper must be at
Packit Service 09cdfc
  version 1.10 or higher to support specifying the gid in non-numeric
Packit Service 09cdfc
  form. See the section on `FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS`_
Packit Service 09cdfc
  below for more information.
Packit Service 09cdfc
Packit Service 09cdfc
forcegid
Packit Service 09cdfc
  instructs the client to ignore any gid provided by the server for
Packit Service 09cdfc
  files and directories and to always assign the owner to be the value
Packit Service 09cdfc
  of the gid= option. See the section on `FILE AND DIRECTORY OWNERSHIP
Packit Service 09cdfc
  AND PERMISSIONS`_ below for more information.
Packit Service 09cdfc
Packit Service 7d3d68
idsfromsid
Packit Service 7d3d68
  Extract uid/gid from special SID instead of mapping it. See the
Packit Service 7d3d68
  section on `FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS`_ below for
Packit Service 7d3d68
  more information.
Packit Service 7d3d68
Packit Service 09cdfc
port=arg
Packit Service 09cdfc
  sets the port number on which the client will attempt to contact the
Packit Service 09cdfc
  CIFS server. If this value is specified, look for an existing
Packit Service 09cdfc
  connection with this port, and use that if one exists. If one doesn't
Packit Service 09cdfc
  exist, try to create a new connection on that port. If that connection
Packit Service 09cdfc
  fails, return an error. If this value isn't specified, look for an
Packit Service 09cdfc
  existing connection on port 445 or 139. If no such connection exists,
Packit Service 09cdfc
  try to connect on port 445 first and then port 139 if that
Packit Service 09cdfc
  fails. Return an error if both fail.
Packit Service 09cdfc
Packit Service 7d3d68
netbiosname=arg
Packit Service 3c3c82
  When mounting to servers via port 139, specifies the RFC1001 source
Packit Service 3c3c82
  name to use to represent the client netbios machine during the netbios
Packit Service 3c3c82
  session initialization.
Packit Service 3c3c82
Packit Service 3c3c82
servern=arg
Packit Service 3c3c82
  Similar to ``netbiosname`` except it specifies the netbios name of
Packit Service 3c3c82
  the server instead of the client. Although rarely needed for mounting
Packit Service 09cdfc
  to newer servers, this option is needed for mounting to some older
Packit Service 09cdfc
  servers (such as OS/2 or Windows 98 and Windows ME) since when
Packit Service 09cdfc
  connecting over port 139 they, unlike most newer servers, do not
Packit Service 09cdfc
  support a default server name. A server name can be up to 15
Packit Service 09cdfc
  characters long and is usually uppercased.
Packit Service 09cdfc
Packit Service 09cdfc
file_mode=arg
Packit Service 09cdfc
  If the server does not support the CIFS Unix extensions this overrides
Packit Service 09cdfc
  the default file mode.
Packit Service 09cdfc
Packit Service 09cdfc
dir_mode=arg
Packit Service 09cdfc
  If the server does not support the CIFS Unix extensions this overrides
Packit Service 09cdfc
  the default mode for directories.
Packit Service 09cdfc
Packit Service 09cdfc
ip=arg|addr=arg
Packit Service 09cdfc
  sets the destination IP address. This option is set automatically if
Packit Service 09cdfc
  the server name portion of the requested UNC name can be resolved so
Packit Service 09cdfc
  rarely needs to be specified by the user.
Packit Service 09cdfc
Packit Service 09cdfc
domain=arg|dom=arg|workgroup=arg
Packit Service 3c3c82
  Sets the domain (workgroup) of the user. If no domains are given,
Packit Service 3c3c82
  the empty domain will be used. Use ``domainauto`` to automatically
Packit Service 3c3c82
  guess the domain of the server you are connecting to.
Packit Service 09cdfc
Packit Service 7d3d68
domainauto
Packit Service 3c3c82
  When using NTLM authentication and not providing a domain via
Packit Service 7d3d68
  ``domain``, guess the domain from the server NTLM challenge.
Packit Service 3c3c82
  This behavior used to be the default on kernels older than 2.6.36.
Packit Service 7d3d68
Packit Service 09cdfc
guest
Packit Service 09cdfc
  don't prompt for a password.
Packit Service 09cdfc
Packit Service 09cdfc
iocharset
Packit Service 09cdfc
  Charset used to convert local path names to and from Unicode. Unicode
Packit Service 09cdfc
  is used by default for network path names if the server supports
Packit Service 09cdfc
  it. If ``iocharset`` is not specified then the ``nls_default`` specified
Packit Service 09cdfc
  during the local client kernel build will be used. If server does not
Packit Service 09cdfc
  support Unicode, this parameter is unused.
Packit Service 09cdfc
Packit Service 09cdfc
ro
Packit Service 09cdfc
  mount read-only.
Packit Service 09cdfc
Packit Service 09cdfc
rw
Packit Service 09cdfc
  mount read-write.
Packit Service 09cdfc
Packit Service 09cdfc
setuids
Packit Service 09cdfc
  If the CIFS Unix extensions are negotiated with the server the client
Packit Service 09cdfc
  will attempt to set the effective uid and gid of the local process on
Packit Service 09cdfc
  newly created files, directories, and devices (create, mkdir,
Packit Service 09cdfc
  mknod). If the CIFS Unix Extensions are not negotiated, for newly
Packit Service 09cdfc
  created files and directories instead of using the default uid and gid
Packit Service 09cdfc
  specified on the the mount, cache the new file's uid and gid locally
Packit Service 09cdfc
  which means that the uid for the file can change when the inode is
Packit Service 09cdfc
  reloaded (or the user remounts the share).
Packit Service 09cdfc
Packit Service 09cdfc
nosetuids
Packit Service 09cdfc
  The client will not attempt to set the uid and gid on on newly created
Packit Service 09cdfc
  files, directories, and devices (create, mkdir, mknod) which will
Packit Service 09cdfc
  result in the server setting the uid and gid to the default (usually
Packit Service 09cdfc
  the server uid of the user who mounted the share). Letting the server
Packit Service 09cdfc
  (rather than the client) set the uid and gid is the default. If the
Packit Service 09cdfc
  CIFS Unix Extensions are not negotiated then the uid and gid for new
Packit Service 09cdfc
  files will appear to be the uid (gid) of the mounter or the uid (gid)
Packit Service 09cdfc
  parameter specified on the mount.
Packit Service 09cdfc
Packit Service 09cdfc
perm
Packit Service 09cdfc
  Client does permission checks (vfs_permission check of uid and gid of
Packit Service 09cdfc
  the file against the mode and desired operation), Note that this is in
Packit Service 09cdfc
  addition to the normal ACL check on the target machine done by the
Packit Service 09cdfc
  server software. Client permission checking is enabled by default.
Packit Service 09cdfc
Packit Service 09cdfc
noperm
Packit Service 09cdfc
  Client does not do permission checks. This can expose files on this
Packit Service 09cdfc
  mount to access by other users on the local client system. It is
Packit Service 09cdfc
  typically only needed when the server supports the CIFS Unix
Packit Service 09cdfc
  Extensions but the UIDs/GIDs on the client and server system do not
Packit Service 09cdfc
  match closely enough to allow access by the user doing the mount. Note
Packit Service 09cdfc
  that this does not affect the normal ACL check on the target machine
Packit Service 09cdfc
  done by the server software (of the server ACL against the user name
Packit Service 09cdfc
  provided at mount time).
Packit Service 09cdfc
Packit Service 09cdfc
dynperm
Packit Service 09cdfc
  Instructs the server to maintain ownership and permissions in memory
Packit Service 09cdfc
  that can't be stored on the server. This information can disappear
Packit Service 09cdfc
  at any time (whenever the inode is flushed from the cache), so while
Packit Service 09cdfc
  this may help make some applications work, it's behavior is somewhat
Packit Service 09cdfc
  unreliable. See the section below on `FILE AND DIRECTORY OWNERSHIP
Packit Service 09cdfc
  AND PERMISSIONS`_ for more information.
Packit Service 09cdfc
Packit Service 09cdfc
cache=arg
Packit Service 09cdfc
  Cache mode. See the section below on `CACHE COHERENCY`_ for
Packit Service 09cdfc
  details. Allowed values are:
Packit Service 09cdfc
Packit Service 09cdfc
  - ``none`` - do not cache file data at all
Packit Service 09cdfc
  - ``strict`` - follow the CIFS/SMB2 protocol strictly
Packit Service 09cdfc
  - ``loose`` - allow loose caching semantics
Packit Service 09cdfc
Packit Service 09cdfc
  The default in kernels prior to 3.7 was ``loose``. As of kernel 3.7 the
Packit Service 09cdfc
  default is ``strict``.
Packit Service 09cdfc
Packit Service 7d3d68
nostrictsync
Packit Service 3c3c82
  Do not ask the server to flush on fsync().
Packit Service 3c3c82
  Some servers perform non-buffered writes by default in which case
Packit Service 3c3c82
  flushing is redundant. In workloads where a client is performing a
Packit Service 3c3c82
  lot of small write + fsync combinations and where network latency is
Packit Service 3c3c82
  much higher than the server latency, this brings a 2x performance
Packit Service 3c3c82
  improvement.
Packit Service 3c3c82
  This option is also a good candidate in scenarios where we want
Packit Service 3c3c82
  performance over consistency.
Packit Service 7d3d68
Packit Service c12e6d
handlecache
Packit Service c12e6d
  (default) In SMB2 and above, the client often has to open the root
Packit Service c12e6d
  of the share (empty path) in various places during mount, path
Packit Service c12e6d
  revalidation and the statfs(2) system call. This option cuts
Packit Service c12e6d
  redundant round trip traffic (opens and closes) by simply keeping
Packit Service c12e6d
  the directory handle for the root around once opened.
Packit Service c12e6d
Packit Service c12e6d
nohandlecache
Packit Service c12e6d
  Disable caching of the share root directory handle.
Packit Service c12e6d
Packit Service 09cdfc
rwpidforward
Packit Service 09cdfc
  Forward pid of a process who opened a file to any read or write
Packit Service 09cdfc
  operation on that file. This prevent applications like wine(1) from
Packit Service 09cdfc
  failing on read and write if we use mandatory brlock style.
Packit Service 09cdfc
Packit Service 09cdfc
mapchars
Packit Service 09cdfc
  Translate six of the seven reserved characters (not backslash, but
Packit Service 09cdfc
  including the colon, question mark, pipe, asterik, greater than and
Packit Service 09cdfc
  less than characters) to the remap range (above 0xF000), which also
Packit Service 09cdfc
  allows the CIFS client to recognize files created with such characters
Packit Service 7d3d68
  by Windows's Services for Mac. This can also be useful when mounting to
Packit Service 09cdfc
  most versions of Samba (which also forbids creating and opening files
Packit Service 09cdfc
  whose names contain any of these seven characters). This has no effect
Packit Service 09cdfc
  if the server does not support Unicode on the wire. Please note that
Packit Service 09cdfc
  the files created with ``mapchars`` mount option may not be accessible
Packit Service 09cdfc
  if the share is mounted without that option.
Packit Service 09cdfc
Packit Service 09cdfc
nomapchars
Packit Service 09cdfc
  (default) Do not translate any of these seven characters.
Packit Service 09cdfc
Packit Service 7d3d68
mapposix
Packit Service 7d3d68
  Translate reserved characters similarly to ``mapchars`` but use the
Packit Service 7d3d68
  mapping from Microsoft "Services For Unix".
Packit Service 7d3d68
Packit Service 09cdfc
intr
Packit Service 09cdfc
  currently unimplemented.
Packit Service 09cdfc
Packit Service 09cdfc
nointr
Packit Service 09cdfc
  (default) currently unimplemented.
Packit Service 09cdfc
Packit Service 09cdfc
hard
Packit Service 09cdfc
  The program accessing a file on the cifs mounted file system will hang
Packit Service 09cdfc
  when the server crashes.
Packit Service 09cdfc
Packit Service 09cdfc
soft
Packit Service 09cdfc
  (default) The program accessing a file on the cifs mounted file system
Packit Service 09cdfc
  will not hang when the server crashes and will return errors to the
Packit Service 09cdfc
  user application.
Packit Service 09cdfc
Packit Service 09cdfc
noacl
Packit Service 09cdfc
  Do not allow POSIX ACL operations even if server would support them.
Packit Service 09cdfc
Packit Service 09cdfc
  The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba
Packit Service 09cdfc
  servers version 3.0.10 and later. Setting POSIX ACLs requires enabling
Packit Service 09cdfc
  both ``CIFS_XATTR`` and then ``CIFS_POSIX`` support in the CIFS
Packit Service 09cdfc
  configuration options when building the cifs module. POSIX ACL support
Packit Service 09cdfc
  can be disabled on a per mount basis by specifying ``noacl`` on mount.
Packit Service 09cdfc
Packit Service 09cdfc
cifsacl
Packit Service 09cdfc
  This option is used to map CIFS/NTFS ACLs to/from Linux permission
Packit Service 09cdfc
  bits, map SIDs to/from UIDs and GIDs, and get and set Security
Packit Service 09cdfc
  Descriptors.
Packit Service 09cdfc
Packit Service 09cdfc
  See section on `CIFS/NTFS ACL, SID/UID/GID MAPPING, SECURITY DESCRIPTORS`_
Packit Service 09cdfc
  for more information.
Packit Service 09cdfc
Packit Service 09cdfc
backupuid=arg
Packit Service 09cdfc
  File access by this user shall be done with the backup intent flag
Packit Service 09cdfc
  set. Either a name or an id must be provided as an argument, there are
Packit Service 09cdfc
  no default values.
Packit Service 09cdfc
Packit Service 09cdfc
  See section `ACCESSING FILES WITH BACKUP INTENT`_ for more details.
Packit Service 09cdfc
Packit Service 09cdfc
backupgid=arg
Packit Service 09cdfc
  File access by users who are members of this group shall be done with
Packit Service 09cdfc
  the backup intent flag set. Either a name or an id must be provided as
Packit Service 09cdfc
  an argument, there are no default values.
Packit Service 09cdfc
Packit Service 09cdfc
  See section `ACCESSING FILES WITH BACKUP INTENT`_ for more details.
Packit Service 09cdfc
Packit Service 09cdfc
nocase
Packit Service 09cdfc
  Request case insensitive path name matching (case sensitive is the default if the
Packit Service 09cdfc
  server supports it).
Packit Service 09cdfc
Packit Service 09cdfc
ignorecase
Packit Service 09cdfc
  Synonym for ``nocase``.
Packit Service 09cdfc
Packit Service 09cdfc
sec=arg
Packit Service 09cdfc
  Security mode. Allowed values are:
Packit Service 09cdfc
Packit Service 09cdfc
  - ``none`` - attempt to connection as a null user (no name)
Packit Service 09cdfc
  - ``krb5`` - Use Kerberos version 5 authentication
Packit Service 09cdfc
  - ``krb5i`` - Use Kerberos authentication and forcibly enable packet signing
Packit Service 09cdfc
  - ``ntlm`` - Use NTLM password hashing
Packit Service 09cdfc
  - ``ntlmi`` - Use NTLM password hashing and force packet signing
Packit Service 09cdfc
  - ``ntlmv2`` - Use NTLMv2 password hashing
Packit Service 09cdfc
  - ``ntlmv2i`` - Use NTLMv2 password hashing and force packet signing
Packit Service 09cdfc
  - ``ntlmssp`` - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message
Packit Service 09cdfc
  - ``ntlmsspi`` - Use NTLMv2 password hashing encapsulated in Raw NTLMSSP message, and force packet signing
Packit Service 09cdfc
Packit Service 09cdfc
  The default in mainline kernel versions prior to v3.8 was
Packit Service 09cdfc
  ``sec=ntlm``. In v3.8, the default was changed to ``sec=ntlmssp``.
Packit Service 09cdfc
Packit Service 09cdfc
  If the server requires signing during protocol negotiation, then it
Packit Service 09cdfc
  may be enabled automatically. Packet signing may also be enabled
Packit Service 09cdfc
  automatically if it's enabled in */proc/fs/cifs/SecurityFlags*.
Packit Service 09cdfc
Packit Service 09cdfc
seal
Packit Service 3c3c82
  Request encryption at the SMB layer. The encryption algorithm used
Packit Service 3c3c82
  is AES-128-CCM. Requires SMB3 or above (see ``vers``).
Packit Service 09cdfc
Packit Service 7d3d68
rdma
Packit Service 3c3c82
  Connect directly to the server using SMB Direct via a RDMA
Packit Service 3c3c82
  adapter. Requires SMB3 or above (see ``vers``).
Packit Service 7d3d68
Packit Service 7d3d68
resilienthandles
Packit Service 7d3d68
  Enable resilient handles. If the server supports it, keep opened
Packit Service 3c3c82
  files across reconnections. Requires SMB2.1 (see ``vers``).
Packit Service 7d3d68
Packit Service 7d3d68
noresilienthandles
Packit Service 7d3d68
  (default) Disable resilient handles.
Packit Service 7d3d68
Packit Service 7d3d68
persistenthandles
Packit Service 7d3d68
  Enable persistent handles. If the server supports it, keep opened
Packit Service 7d3d68
  files across reconnections. Persistent handles are also valid across
Packit Service 3c3c82
  servers in a cluster and have stronger guarantees than resilient
Packit Service 3c3c82
  handles. Requires SMB3 or above (see ``vers``).
Packit Service 7d3d68
Packit Service 7d3d68
nopersistenthandles
Packit Service 7d3d68
  (default) Disable persistent handles.
Packit Service 7d3d68
Packit Service 09cdfc
nobrl
Packit Service 09cdfc
  Do not send byte range lock requests to the server. This is necessary
Packit Service 09cdfc
  for certain applications that break with cifs style mandatory byte
Packit Service 09cdfc
  range locks (and most cifs servers do not yet support requesting
Packit Service 09cdfc
  advisory byte range locks).
Packit Service 09cdfc
Packit Service 7d3d68
forcemandatorylock
Packit Service 7d3d68
  Do not use POSIX locks even when available via unix
Packit Service 7d3d68
  extensions. Always use cifs style mandatory locks.
Packit Service 7d3d68
Packit Service 7d3d68
locallease
Packit Service 3c3c82
  Check cached leases locally instead of querying the server.
Packit Service 7d3d68
Packit Service 09cdfc
sfu
Packit Service 09cdfc
  When the CIFS Unix Extensions are not negotiated, attempt to create
Packit Service 09cdfc
  device files and fifos in a format compatible with Services for Unix
Packit Service 09cdfc
  (SFU). In addition retrieve bits 10-12 of the mode via the
Packit Service 09cdfc
  ``SETFILEBITS`` extended attribute (as SFU does). In the future the
Packit Service 09cdfc
  bottom 9 bits of the mode mode also will be emulated using queries of
Packit Service 09cdfc
  the security descriptor (ACL). [NB: requires version 1.39 or later of
Packit Service 09cdfc
  the CIFS VFS. To recognize symlinks and be able to create symlinks in
Packit Service 09cdfc
  an SFU interoperable form requires version 1.40 or later of the CIFS
Packit Service 09cdfc
  VFS kernel module.
Packit Service 09cdfc
Packit Service 09cdfc
mfsymlinks
Packit Service 09cdfc
  Enable support for Minshall+French symlinks (see
Packit Service 09cdfc
  `http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks <http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks>`_). This
Packit Service 09cdfc
  option is ignored when specified together with the ``sfu``
Packit Service 09cdfc
  option. Minshall+French symlinks are used even if the server supports
Packit Service 09cdfc
  the CIFS Unix Extensions.
Packit Service 09cdfc
Packit Service 09cdfc
echo_interval=n
Packit Service 09cdfc
  sets the interval at which echo requests are sent to the server on an
Packit Service 09cdfc
  idling connection. This setting also affects the time required for a
Packit Service 09cdfc
  connection to an unresponsive server to timeout. Here n is the echo
Packit Service 09cdfc
  interval in seconds. The reconnection happens at twice the value of the
Packit Service 09cdfc
  echo_interval set for an unresponsive server.
Packit Service 09cdfc
  If this option is not given then the default value of 60 seconds is used.
Packit Service 09cdfc
  The minimum tunable value is 1 second and maximum can go up to 600 seconds.
Packit Service 09cdfc
Packit Service 09cdfc
serverino
Packit Service 09cdfc
  Use inode numbers (unique persistent file identifiers) returned by the
Packit Service 09cdfc
  server instead of automatically generating temporary inode numbers on
Packit Service 09cdfc
  the client. Although server inode numbers make it easier to spot
Packit Service 09cdfc
  hardlinked files (as they will have the same inode numbers) and inode
Packit Service 09cdfc
  numbers may be persistent (which is useful for some software), the
Packit Service 09cdfc
  server does not guarantee that the inode numbers are unique if
Packit Service 09cdfc
  multiple server side mounts are exported under a single share (since
Packit Service 09cdfc
  inode numbers on the servers might not be unique if multiple
Packit Service 09cdfc
  filesystems are mounted under the same shared higher level
Packit Service 09cdfc
  directory). Note that not all servers support returning server inode
Packit Service 09cdfc
  numbers, although those that support the CIFS Unix Extensions, and
Packit Service 09cdfc
  Windows 2000 and later servers typically do support this (although not
Packit Service 09cdfc
  necessarily on every local server filesystem). Parameter has no effect
Packit Service 09cdfc
  if the server lacks support for returning inode numbers or
Packit Service 09cdfc
  equivalent. This behavior is enabled by default.
Packit Service 09cdfc
Packit Service 09cdfc
noserverino
Packit Service 09cdfc
  Client generates inode numbers itself rather than using the actual
Packit Service 09cdfc
  ones from the server.
Packit Service 09cdfc
Packit Service 09cdfc
  See section `INODE NUMBERS`_ for more information.
Packit Service 09cdfc
Packit Service 7d3d68
unix|linux
Packit Service 7d3d68
  (default) Enable Unix Extensions for this mount. Requires CIFS
Packit Service 7d3d68
  (vers=1.0) or SMB3.1.1 (vers=3.1.1) and a server supporting them.
Packit Service 7d3d68
Packit Service 7d3d68
nounix|nolinux
Packit Service 7d3d68
  Disable the Unix Extensions for this mount. This can be useful in
Packit Service 09cdfc
  order to turn off multiple settings at once. This includes POSIX acls,
Packit Service 09cdfc
  POSIX locks, POSIX paths, symlink support and retrieving
Packit Service 09cdfc
  uids/gids/mode from the server. This can also be useful to work around
Packit Service 09cdfc
  a bug in a server that supports Unix Extensions.
Packit Service 09cdfc
Packit Service 09cdfc
  See section `INODE NUMBERS`_ for more information.
Packit Service 09cdfc
Packit Service 09cdfc
nouser_xattr
Packit Service 09cdfc
  Do not allow getfattr/setfattr to get/set xattrs, even if server would
Packit Service 09cdfc
  support it otherwise. The default is for xattr support to be enabled.
Packit Service 09cdfc
Packit Service 7d3d68
nodfs
Packit Service 3c3c82
  Do not follow Distributed FileSystem referrals. IO on a file not
Packit Service 7d3d68
  stored on the server will fail instead of connecting to the target
Packit Service 7d3d68
  server transparently.
Packit Service 7d3d68
Packit Service 7d3d68
noautotune
Packit Service 7d3d68
  Use fixed size for kernel recv/send socket buffers.
Packit Service 7d3d68
Packit Service 7d3d68
nosharesock
Packit Service 7d3d68
  Do not try to reuse sockets if the system is already connected to
Packit Service 7d3d68
  the server via an existing mount point. This will make the client
Packit Service 7d3d68
  always make a new connection to the server no matter what he is
Packit Service 7d3d68
  already connected to.
Packit Service 7d3d68
Packit Service 7d3d68
noblocksend
Packit Service 7d3d68
  Send data on the socket using non blocking operations (MSG_DONTWAIT flag).
Packit Service 7d3d68
Packit Service 09cdfc
rsize=bytes
Packit Service 09cdfc
  Maximum amount of data that the kernel will request in a read request
Packit Service 09cdfc
  in bytes. Prior to kernel 3.2.0, the default was 16k, and the maximum
Packit Service 09cdfc
  size was limited by the ``CIFSMaxBufSize`` module parameter. As of
Packit Service 09cdfc
  kernel 3.2.0, the behavior varies according to whether POSIX
Packit Service 09cdfc
  extensions are enabled on the mount and the server supports large
Packit Service 09cdfc
  POSIX reads. If they are, then the default is 1M, and the maximum is
Packit Service 09cdfc
  16M. If they are not supported by the server, then the default is 60k
Packit Service 09cdfc
  and the maximum is around 127k. The reason for the 60k is because it's
Packit Service 09cdfc
  the maximum size read that windows servers can fill. Note that this
Packit Service 09cdfc
  value is a maximum, and the client may settle on a smaller size to
Packit Service 09cdfc
  accommodate what the server supports. In kernels prior to 3.2.0, no
Packit Service 09cdfc
  negotiation is performed.
Packit Service 09cdfc
Packit Service 09cdfc
wsize=bytes
Packit Service 09cdfc
  Maximum amount of data that the kernel will send in a write request in
Packit Service 09cdfc
  bytes. Prior to kernel 3.0.0, the default and maximum was 57344 (14 \*
Packit Service 09cdfc
  4096 pages). As of 3.0.0, the default depends on whether the client
Packit Service 09cdfc
  and server negotiate large writes via POSIX extensions. If they do,
Packit Service 09cdfc
  then the default is 1M, and the maximum allowed is 16M. If they do
Packit Service 09cdfc
  not, then the default is 65536 and the maximum allowed is 131007. Note
Packit Service 09cdfc
  that this value is just a starting point for negotiation in 3.0.0 and
Packit Service 09cdfc
  up. The client and server may negotiate this size downward according
Packit Service 09cdfc
  to the server's capabilities. In kernels prior to 3.0.0, no
Packit Service 09cdfc
  negotiation is performed. It can end up with an existing superblock if
Packit Service 09cdfc
  this value isn't specified or it's greater or equal than the existing
Packit Service 09cdfc
  one.
Packit Service 09cdfc
Packit Service 7d3d68
max_credits=n
Packit Service 7d3d68
  Maximum credits the SMB2 client can have. Default is 32000. Must be
Packit Service 7d3d68
  set to a number between 20 and 60000.
Packit Service 7d3d68
Packit Service 09cdfc
fsc
Packit Service 09cdfc
  Enable local disk caching using FS-Cache for CIFS. This option could
Packit Service 09cdfc
  be useful to improve performance on a slow link, heavily loaded server
Packit Service 09cdfc
  and/or network where reading from the disk is faster than reading from
Packit Service 09cdfc
  the server (over the network). This could also impact the scalability
Packit Service 09cdfc
  positively as the number of calls to the server are reduced. But, be
Packit Service 09cdfc
  warned that local caching is not suitable for all workloads, for e.g.,
Packit Service 09cdfc
  read-once type workloads. So, you need to consider carefully the
Packit Service 09cdfc
  situation/workload before using this option. Currently, local disk
Packit Service 09cdfc
  caching is enabled for CIFS files opened as read-only.
Packit Service 09cdfc
Packit Service 09cdfc
  **NOTE**: This feature is available only in the recent kernels that
Packit Service 09cdfc
  have been built with the kernel config option
Packit Service 09cdfc
  ``CONFIG_CIFS_FSCACHE``. You also need to have ``cachefilesd``
Packit Service 09cdfc
  daemon installed and running to make the cache operational.
Packit Service 09cdfc
Packit Service 09cdfc
multiuser
Packit Service 09cdfc
  Map user accesses to individual credentials when accessing the
Packit Service 09cdfc
  server. By default, CIFS mounts only use a single set of user
Packit Service 09cdfc
  credentials (the mount credentials) when accessing a share. With this
Packit Service 09cdfc
  option, the client instead creates a new session with the server using
Packit Service 09cdfc
  the user's credentials whenever a new user accesses the mount.
Packit Service 09cdfc
  Further accesses by that user will also use those credentials. Because
Packit Service 09cdfc
  the kernel cannot prompt for passwords, multiuser mounts are limited
Packit Service 09cdfc
  to mounts using ``sec=`` options that don't require passwords.
Packit Service 09cdfc
Packit Service 09cdfc
  With this change, it's feasible for the server to handle permissions
Packit Service 09cdfc
  enforcement, so this option also implies ``noperm`` . Furthermore, when
Packit Service 09cdfc
  unix extensions aren't in use and the administrator has not overridden
Packit Service 09cdfc
  ownership using the ``uid=`` or ``gid=`` options, ownership of files is
Packit Service 09cdfc
  presented as the current user accessing the share.
Packit Service 09cdfc
Packit Service 09cdfc
actimeo=arg
Packit Service 09cdfc
  The time (in seconds) that the CIFS client caches attributes of a file or
Packit Service 09cdfc
  directory before it requests attribute information from a server. During this
Packit Service 09cdfc
  period the changes that occur on the server remain undetected until the client
Packit Service 09cdfc
  checks the server again.
Packit Service 09cdfc
Packit Service 09cdfc
  By default, the attribute cache timeout is set to 1 second. This means
Packit Service 09cdfc
  more frequent on-the-wire calls to the server to check whether
Packit Service 09cdfc
  attributes have changed which could impact performance. With this
Packit Service 09cdfc
  option users can make a tradeoff between performance and cache
Packit Service 09cdfc
  metadata correctness, depending on workload needs. Shorter timeouts
Packit Service 09cdfc
  mean better cache coherency, but frequent increased number of calls to
Packit Service 09cdfc
  the server. Longer timeouts mean a reduced number of calls to the
Packit Service 09cdfc
  server but looser cache coherency. The ``actimeo`` value is a positive
Packit Service 09cdfc
  integer that can hold values between 0 and a maximum value of 2^30 \*
Packit Service 09cdfc
  HZ (frequency of timer interrupt) setting.
Packit Service 09cdfc
Packit Service 09cdfc
noposixpaths
Packit Service 09cdfc
  If unix extensions are enabled on a share, then the client will
Packit Service 09cdfc
  typically allow filenames to include any character besides '/' in a
Packit Service 09cdfc
  pathname component, and will use forward slashes as a pathname
Packit Service 09cdfc
  delimiter. This option prevents the client from attempting to
Packit Service 09cdfc
  negotiate the use of posix-style pathnames to the server.
Packit Service 09cdfc
Packit Service 09cdfc
posixpaths
Packit Service 09cdfc
  Inverse of ``noposixpaths`` .
Packit Service 09cdfc
Packit Service 09cdfc
prefixpath=arg
Packit Service 09cdfc
  It's possible to mount a subdirectory of a share. The preferred way to
Packit Service 09cdfc
  do this is to append the path to the UNC when mounting. However, it's
Packit Service 09cdfc
  also possible to do the same by setting this option and providing the
Packit Service 09cdfc
  path there.
Packit Service 09cdfc
Packit Service 09cdfc
vers=arg
Packit Service 09cdfc
  SMB protocol version. Allowed values are:
Packit Service 09cdfc
Packit Service 09cdfc
  - 1.0 - The classic CIFS/SMBv1 protocol.
Packit Service 09cdfc
  - 2.0 - The SMBv2.002 protocol. This was initially introduced in
Packit Service 09cdfc
    Windows Vista Service Pack 1, and Windows Server 2008. Note that
Packit Service 09cdfc
    the initial release version of Windows Vista spoke a slightly
Packit Service 09cdfc
    different dialect (2.000) that is not supported.
Packit Service 09cdfc
  - 2.1 - The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.
Packit Service 09cdfc
  - 3.0 - The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.
Packit Service 4870a9
  - 3.02 or 3.0.2 - The SMBv3.0.2 protocol that was introduced in Microsoft Windows 8.1 and Windows Server 2012R2.
Packit Service 09cdfc
  - 3.1.1 or 3.11 - The SMBv3.1.1 protocol that was introduced in Microsoft Windows Server 2016.
Packit Service 342b37
  - 3 - The SMBv3.0 protocol version and above.
Packit Service 4870a9
  - default - Tries to negotiate the highest SMB2+ version supported by both the client and server.
Packit Service 4870a9
Packit Service 4870a9
  If no dialect is specified on mount vers=default is used.
Packit Service 4870a9
  To check ``Dialect`` refer to /proc/fs/cifs/DebugData
Packit Service 09cdfc
Packit Service 09cdfc
  Note too that while this option governs the protocol version used, not
Packit Service 09cdfc
  all features of each version are available.
Packit Service 09cdfc
Packit Service 09cdfc
  The default since v4.13.5 is for the client and server to negotiate
Packit Service 09cdfc
  the highest possible version greater than or equal to ``2.1``. In
Packit Service 09cdfc
  kernels prior to v4.13, the default was ``1.0``. For kernels
Packit Service 09cdfc
  between v4.13 and v4.13.5 the default is ``3.0``.
Packit Service 09cdfc
Packit Service 09cdfc
--verbose
Packit Service 09cdfc
  Print additional debugging information for the mount. Note that this
Packit Service 09cdfc
  parameter must be specified before the ``-o`` . For example::
Packit Service 09cdfc
Packit Service 09cdfc
    mount -t cifs //server/share /mnt --verbose -o user=username
Packit Service 09cdfc
Packit Service 09cdfc
Packit Service 09cdfc
*********************************
Packit Service 09cdfc
SERVICE FORMATTING AND DELIMITERS
Packit Service 09cdfc
*********************************
Packit Service 09cdfc
Packit Service 09cdfc
It's generally preferred to use forward slashes (/) as a delimiter in
Packit Service 09cdfc
service names. They are considered to be the "universal delimiter"
Packit Service 09cdfc
since they are generally not allowed to be embedded within path
Packit Service 09cdfc
components on Windows machines and the client can convert them to
Packit Service 664a73
backslashes (\\) unconditionally. Conversely, backslash characters are
Packit Service 09cdfc
allowed by POSIX to be part of a path component, and can't be
Packit Service 09cdfc
automatically converted in the same way.
Packit Service 09cdfc
Packit Service 09cdfc
``mount.cifs`` will attempt to convert backslashes to forward slashes
Packit Service 09cdfc
where it's able to do so, but it cannot do so in any path component
Packit Service 09cdfc
following the sharename.
Packit Service 09cdfc
Packit Service 09cdfc
Packit Service 09cdfc
*************
Packit Service 09cdfc
INODE NUMBERS
Packit Service 09cdfc
*************
Packit Service 09cdfc
Packit Service 09cdfc
Packit Service 09cdfc
When Unix Extensions are enabled, we use the actual inode number
Packit Service 09cdfc
provided by the server in response to the POSIX calls as an inode
Packit Service 09cdfc
number.
Packit Service 09cdfc
Packit Service 09cdfc
When Unix Extensions are disabled and ``serverino`` mount option is
Packit Service 09cdfc
enabled there is no way to get the server inode number. The client
Packit Service 09cdfc
typically maps the server-assigned ``UniqueID`` onto an inode number.
Packit Service 09cdfc
Packit Service 09cdfc
Note that the ``UniqueID`` is a different value from the server inode
Packit Service 09cdfc
number. The ``UniqueID`` value is unique over the scope of the entire
Packit Service 09cdfc
server and is often greater than 2 power 32. This value often makes
Packit Service 09cdfc
programs that are not compiled with LFS (Large File Support), to
Packit Service 09cdfc
trigger a glibc ``EOVERFLOW`` error as this won't fit in the target
Packit Service 09cdfc
structure field. It is strongly recommended to compile your programs
Packit Service 09cdfc
with LFS support (i.e. with ``-D_FILE_OFFSET_BITS=64``) to prevent this
Packit Service 09cdfc
problem. You can also use ``noserverino`` mount option to generate
Packit Service 09cdfc
inode numbers smaller than 2 power 32 on the client. But you may not
Packit Service 09cdfc
be able to detect hardlinks properly.
Packit Service 09cdfc
Packit Service 09cdfc
***************
Packit Service 09cdfc
CACHE COHERENCY
Packit Service 09cdfc
***************
Packit Service 09cdfc
Packit Service 09cdfc
With a network filesystem such as CIFS or NFS, the client must contend
Packit Service 09cdfc
with the fact that activity on other clients or the server could
Packit Service 09cdfc
change the contents or attributes of a file without the client being
Packit Service 09cdfc
aware of it. One way to deal with such a problem is to mandate that
Packit Service 09cdfc
all file accesses go to the server directly. This is performance
Packit Service 09cdfc
prohibitive however, so most protocols have some mechanism to allow
Packit Service 09cdfc
the client to cache data locally.
Packit Service 09cdfc
Packit Service 09cdfc
The CIFS protocol mandates (in effect) that the client should not
Packit Service 09cdfc
cache file data unless it holds an opportunistic lock (aka oplock) or
Packit Service 09cdfc
a lease. Both of these entities allow the client to guarantee certain
Packit Service 09cdfc
types of exclusive access to a file so that it can access its contents
Packit Service 09cdfc
without needing to continually interact with the server. The server
Packit Service 09cdfc
will call back the client when it needs to revoke either of them and
Packit Service 09cdfc
allow the client a certain amount of time to flush any cached data.
Packit Service 09cdfc
Packit Service 09cdfc
The cifs client uses the kernel's pagecache to cache file data. Any
Packit Service 09cdfc
I/O that's done through the pagecache is generally page-aligned. This
Packit Service 09cdfc
can be problematic when combined with byte-range locks as Windows'
Packit Service 09cdfc
locking is mandatory and can block reads and writes from occurring.
Packit Service 09cdfc
Packit Service 09cdfc
``cache=none`` means that the client never utilizes the cache for
Packit Service 09cdfc
normal reads and writes. It always accesses the server directly to
Packit Service 09cdfc
satisfy a read or write request.
Packit Service 09cdfc
Packit Service 09cdfc
``cache=strict`` means that the client will attempt to follow the
Packit Service 09cdfc
CIFS/SMB2 protocol strictly. That is, the cache is only trusted when
Packit Service 09cdfc
the client holds an oplock. When the client does not hold an oplock,
Packit Service 09cdfc
then the client bypasses the cache and accesses the server directly to
Packit Service 09cdfc
satisfy a read or write request. By doing this, the client avoids
Packit Service 09cdfc
problems with byte range locks. Additionally, byte range locks are
Packit Service 09cdfc
cached on the client when it holds an oplock and are "pushed" to the
Packit Service 09cdfc
server when that oplock is recalled.
Packit Service 09cdfc
Packit Service 09cdfc
``cache=loose`` allows the client to use looser protocol semantics
Packit Service 09cdfc
which can sometimes provide better performance at the expense of cache
Packit Service 09cdfc
coherency. File access always involves the pagecache. When an oplock
Packit Service 09cdfc
or lease is not held, then the client will attempt to flush the cache
Packit Service 09cdfc
soon after a write to a file. Note that that flush does not
Packit Service 09cdfc
necessarily occur before a write system call returns.
Packit Service 09cdfc
Packit Service 09cdfc
In the case of a read without holding an oplock, the client will
Packit Service 09cdfc
attempt to periodically check the attributes of the file in order to
Packit Service 09cdfc
ascertain whether it has changed and the cache might no longer be
Packit Service 09cdfc
valid. This mechanism is much like the one that NFSv2/3 use for cache
Packit Service 09cdfc
coherency, but it particularly problematic with CIFS. Windows is
Packit Service 09cdfc
quite "lazy" with respect to updating the ``LastWriteTime`` field that
Packit Service 09cdfc
the client uses to verify this. The effect is that ``cache=loose`` can
Packit Service 09cdfc
cause data corruption when multiple readers and writers are working on
Packit Service 09cdfc
the same files.
Packit Service 09cdfc
Packit Service 09cdfc
Because of this, when multiple clients are accessing the same set of
Packit Service 09cdfc
files, then ``cache=strict`` is recommended. That helps eliminate
Packit Service 09cdfc
problems with cache coherency by following the CIFS/SMB2 protocols
Packit Service 09cdfc
more strictly.
Packit Service 09cdfc
Packit Service 09cdfc
Note too that no matter what caching model is used, the client will
Packit Service 09cdfc
always use the pagecache to handle mmap'ed files. Writes to mmap'ed
Packit Service 09cdfc
files are only guaranteed to be flushed to the server when msync() is
Packit Service 09cdfc
called, or on close().
Packit Service 09cdfc
Packit Service 09cdfc
The default in kernels prior to 3.7 was ``loose``. As of 3.7, the
Packit Service 09cdfc
default is ``strict``.
Packit Service 09cdfc
Packit Service 09cdfc
********************************************************
Packit Service 09cdfc
CIFS/NTFS ACL, SID/UID/GID MAPPING, SECURITY DESCRIPTORS
Packit Service 09cdfc
********************************************************
Packit Service 09cdfc
Packit Service 09cdfc
This option is used to work with file objects which posses Security
Packit Service 09cdfc
Descriptors and CIFS/NTFS ACL instead of UID, GID, file permission
Packit Service 09cdfc
bits, and POSIX ACL as user authentication model. This is the most
Packit Service 09cdfc
common authentication model for CIFS servers and is the one used by
Packit Service 09cdfc
Windows.
Packit Service 09cdfc
Packit Service 09cdfc
Support for this requires both CIFS_XATTR and CIFS_ACL support in the
Packit Service 09cdfc
CIFS configuration options when building the cifs module.
Packit Service 09cdfc
Packit Service 09cdfc
A CIFS/NTFS ACL is mapped to file permission bits using an algorithm
Packit Service 09cdfc
specified in the following Microsoft TechNet document:
Packit Service 09cdfc
Packit Service 09cdfc
`http://technet.microsoft.com/en-us/library/bb463216.aspx <http://technet.microsoft.com/en-us/library/bb463216.aspx>`_
Packit Service 09cdfc
Packit Service 09cdfc
In order to map SIDs to/from UIDs and GIDs, the following is required:
Packit Service 09cdfc
Packit Service 09cdfc
- a kernel upcall to the ``cifs.idmap`` utility set up via request-key.conf(5)
Packit Service 09cdfc
- winbind support configured via nsswitch.conf(5) and smb.conf(5)
Packit Service 09cdfc
Packit Service 09cdfc
Please refer to the respective manpages of cifs.idmap(8) and
Packit Service 09cdfc
winbindd(8) for more information.
Packit Service 09cdfc
Packit Service 09cdfc
Security descriptors for a file object can be retrieved and set
Packit Service 09cdfc
directly using extended attribute named ``system.cifs_acl``. The
Packit Service 09cdfc
security descriptors presented via this interface are "raw" blobs of
Packit Service 09cdfc
data and need a userspace utility to either parse and format or to
Packit Service 09cdfc
assemble it such as getcifsacl(1) and setcifsacl(1)
Packit Service 09cdfc
respectively.
Packit Service 09cdfc
Packit Service 09cdfc
Some of the things to consider while using this mount option:
Packit Service 09cdfc
Packit Service 09cdfc
- There may be an increased latency when handling metadata due to
Packit Service 09cdfc
  additional requests to get and set security descriptors.
Packit Service 09cdfc
- The mapping between a CIFS/NTFS ACL and POSIX file permission bits
Packit Service 09cdfc
  is imperfect and some ACL information may be lost in the
Packit Service 09cdfc
  translation.
Packit Service 09cdfc
- If either upcall to cifs.idmap is not setup correctly or winbind is
Packit Service 09cdfc
  not configured and running, ID mapping will fail. In that case uid
Packit Service 09cdfc
  and gid will default to either to those values of the share or to
Packit Service 09cdfc
  the values of uid and/or gid mount options if specified.
Packit Service 09cdfc
Packit Service 09cdfc
**********************************
Packit Service 09cdfc
ACCESSING FILES WITH BACKUP INTENT
Packit Service 09cdfc
**********************************
Packit Service 09cdfc
Packit Service 09cdfc
For an user on the server, desired access to a file is determined by
Packit Service 09cdfc
the permissions and rights associated with that file. This is
Packit Service 09cdfc
typically accomplished using ownership and ACL. For a user who does
Packit Service 09cdfc
not have access rights to a file, it is still possible to access that
Packit Service 09cdfc
file for a specific or a targeted purpose by granting special rights.
Packit Service 09cdfc
One of the specific purposes is to access a file with the intent to
Packit Service 09cdfc
either backup or restore i.e. backup intent. The right to access a
Packit Service 09cdfc
file with the backup intent can typically be granted by making that
Packit Service 09cdfc
user a part of the built-in group *Backup Operators*. Thus, when
Packit Service 09cdfc
this user attempts to open a file with the backup intent, open request
Packit Service 09cdfc
is sent by setting the bit ``FILE_OPEN_FOR_BACKUP_INTENT`` as one of
Packit Service 09cdfc
the ``CreateOptions``.
Packit Service 09cdfc
Packit Service 09cdfc
As an example, on a Windows server, a user named *testuser*, cannot open
Packit Service 09cdfc
this file with such a security descriptor::
Packit Service 09cdfc
Packit Service 09cdfc
    REVISION:0x1
Packit Service 09cdfc
    CONTROL:0x9404
Packit Service 09cdfc
    OWNER:Administrator
Packit Service 09cdfc
    GROUP:Domain Users
Packit Service 09cdfc
    ACL:Administrator:ALLOWED/0x0/FULL
Packit Service 09cdfc
Packit Service 09cdfc
But the user *testuser*, if it becomes part of the *Backup Operators*
Packit Service 09cdfc
group, can open the file with the backup intent.
Packit Service 09cdfc
Packit Service 09cdfc
Any user on the client side who can authenticate as such a user on the
Packit Service 09cdfc
server, can access the files with the backup intent. But it is
Packit Service 09cdfc
desirable and preferable for security reasons amongst many, to
Packit Service 09cdfc
restrict this special right.
Packit Service 09cdfc
Packit Service 09cdfc
The mount option ``backupuid`` is used to restrict this special right
Packit Service 09cdfc
to a user which is specified by either a name or an id. The mount
Packit Service 09cdfc
option ``backupgid`` is used to restrict this special right to the
Packit Service 09cdfc
users in a group which is specified by either a name or an id. Only
Packit Service 09cdfc
users matching either backupuid or backupgid shall attempt to access
Packit Service 09cdfc
files with backup intent. These two mount options can be used
Packit Service 09cdfc
together.
Packit Service 09cdfc
Packit Service 09cdfc
********************************************
Packit Service 09cdfc
FILE AND DIRECTORY OWNERSHIP AND PERMISSIONS
Packit Service 09cdfc
********************************************
Packit Service 09cdfc
Packit Service 09cdfc
The core CIFS protocol does not provide unix ownership information or
Packit Service 09cdfc
mode for files and directories. Because of this, files and directories
Packit Service 09cdfc
will generally appear to be owned by whatever values the ``uid=`` or
Packit Service 09cdfc
``gid=`` options are set, and will have permissions set to the default
Packit Service 09cdfc
``file_mode`` and ``dir_mode`` for the mount. Attempting to change these
Packit Service 09cdfc
values via chmod/chown will return success but have no effect.
Packit Service 09cdfc
Packit Service 09cdfc
When the client and server negotiate unix extensions, files and
Packit Service 09cdfc
directories will be assigned the uid, gid, and mode provided by the
Packit Service 09cdfc
server. Because CIFS mounts are generally single-user, and the same
Packit Service 09cdfc
credentials are used no matter what user accesses the mount, newly
Packit Service 09cdfc
created files and directories will generally be given ownership
Packit Service 09cdfc
corresponding to whatever credentials were used to mount the share.
Packit Service 09cdfc
Packit Service 09cdfc
If the uid's and gid's being used do not match on the client and
Packit Service 09cdfc
server, the ``forceuid`` and ``forcegid`` options may be helpful. Note
Packit Service 09cdfc
however, that there is no corresponding option to override the
Packit Service 09cdfc
mode. Permissions assigned to a file when ``forceuid`` or ``forcegid``
Packit Service 09cdfc
are in effect may not reflect the the real permissions.
Packit Service 09cdfc
Packit Service 09cdfc
When unix extensions are not negotiated, it's also possible to emulate
Packit Service 09cdfc
them locally on the server using the ``dynperm`` mount option. When
Packit Service 09cdfc
this mount option is in effect, newly created files and directories
Packit Service 09cdfc
will receive what appear to be proper permissions. These permissions
Packit Service 09cdfc
are not stored on the server however and can disappear at any time in
Packit Service 09cdfc
the future (subject to the whims of the kernel flushing out the inode
Packit Service 09cdfc
cache). In general, this mount option is discouraged.
Packit Service 09cdfc
Packit Service 09cdfc
It's also possible to override permission checking on the client
Packit Service 09cdfc
altogether via the ``noperm`` option. Server-side permission checks
Packit Service 09cdfc
cannot be overridden. The permission checks done by the server will
Packit Service 09cdfc
always correspond to the credentials used to mount the share, and not
Packit Service 09cdfc
necessarily to the user who is accessing the share.
Packit Service 09cdfc
Packit Service 09cdfc
*********************
Packit Service 09cdfc
ENVIRONMENT VARIABLES
Packit Service 09cdfc
*********************
Packit Service 09cdfc
Packit Service 09cdfc
The variable ``USER`` may contain the username of the person to be used
Packit Service 09cdfc
to authenticate to the server. The variable can be used to set both
Packit Service 09cdfc
username and password by using the format ``username%password``.
Packit Service 09cdfc
Packit Service 09cdfc
The variable ``PASSWD`` may contain the password of the person using
Packit Service 09cdfc
the client.
Packit Service 09cdfc
Packit Service 09cdfc
The variable ``PASSWD_FILE`` may contain the pathname of a file to read
Packit Service 09cdfc
the password from. A single line of input is read and used as the
Packit Service 09cdfc
password.
Packit Service 09cdfc
Packit Service 09cdfc
*****
Packit Service 09cdfc
NOTES
Packit Service 09cdfc
*****
Packit Service 09cdfc
Packit Service 09cdfc
This command may be used only by root, unless installed setuid, in
Packit Service 09cdfc
which case the noexec and nosuid mount flags are enabled. When
Packit Service 09cdfc
installed as a setuid program, the program follows the conventions set
Packit Service 09cdfc
forth by the mount program for user mounts, with the added restriction
Packit Service 09cdfc
that users must be able to chdir() into the mountpoint prior to the
Packit Service 09cdfc
mount in order to be able to mount onto it.
Packit Service 09cdfc
Packit Service 09cdfc
Some samba client tools like smbclient(8) honour client-side
Packit Service 09cdfc
configuration parameters present in *smb.conf*. Unlike those client
Packit Service 09cdfc
tools, ``mount.cifs`` ignores *smb.conf* completely.
Packit Service 09cdfc
Packit Service 09cdfc
*************
Packit Service 09cdfc
CONFIGURATION
Packit Service 09cdfc
*************
Packit Service 09cdfc
Packit Service 09cdfc
The primary mechanism for making configuration changes and for reading
Packit Service 09cdfc
debug information for the cifs vfs is via the Linux /proc
Packit Service 09cdfc
filesystem. In the directory */proc/fs/cifs* are various
Packit Service 09cdfc
configuration files and pseudo files which can display debug
Packit Service 09cdfc
information. There are additional startup options such as maximum
Packit Service 09cdfc
buffer size and number of buffers which only may be set when the
Packit Service 09cdfc
kernel cifs vfs (cifs.ko module) is loaded. These can be seen by
Packit Service 09cdfc
running the ``modinfo`` utility against the file cifs.ko which will
Packit Service 09cdfc
list the options that may be passed to cifs during module installation
Packit Service 09cdfc
(device driver load). For more information see the kernel file
Packit Service 09cdfc
*fs/cifs/README*.
Packit Service 09cdfc
Packit Service 09cdfc
****
Packit Service 09cdfc
BUGS
Packit Service 09cdfc
****
Packit Service 09cdfc
Packit Service 09cdfc
Mounting using the CIFS URL specification is currently not supported.
Packit Service 09cdfc
Packit Service 09cdfc
The credentials file does not handle usernames or passwords with
Packit Service 09cdfc
leading space.
Packit Service 09cdfc
Packit Service 09cdfc
Note that the typical response to a bug report is a suggestion to try
Packit Service 09cdfc
the latest version first. So please try doing that first, and always
Packit Service 09cdfc
include which versions you use of relevant software when reporting
Packit Service 09cdfc
bugs (minimum: mount.cifs (try ``mount.cifs -V``), kernel (see
Packit Service 09cdfc
*/proc/version*) and server type you are trying to contact.
Packit Service 09cdfc
Packit Service 09cdfc
*******
Packit Service 09cdfc
VERSION
Packit Service 09cdfc
*******
Packit Service 09cdfc
Packit Service 09cdfc
This man page is correct for version 1.74 of the cifs vfs filesystem
Packit Service 09cdfc
(roughly Linux kernel 3.0).
Packit Service 09cdfc
Packit Service 09cdfc
********
Packit Service 09cdfc
SEE ALSO
Packit Service 09cdfc
********
Packit Service 09cdfc
Packit Service 09cdfc
cifs.upcall(8), getcifsacl(1), setcifsacl(1)
Packit Service 09cdfc
Packit Service 09cdfc
*Documentation/filesystems/cifs.txt* and *fs/cifs/README* in the
Packit Service 09cdfc
Linux kernel source tree may contain additional options and
Packit Service 09cdfc
information.
Packit Service 09cdfc
Packit Service 09cdfc
******
Packit Service 09cdfc
AUTHOR
Packit Service 09cdfc
******
Packit Service 09cdfc
Packit Service 09cdfc
Steve French
Packit Service 09cdfc
Packit Service 09cdfc
The maintainer of the Linux cifs vfs and the userspace tool mount.cifs
Packit Service 09cdfc
is Steve French. The Linux CIFS Mailing list is the preferred place to
Packit Service 09cdfc
ask questions regarding these programs.