brintos

brintos / linux-shallow public Read only

0
0
Text · 39.0 KiB · c09674a Raw
863 lines · plain
1=====2Usage3=====4 5This module supports the SMB3 family of advanced network protocols (as well6as older dialects, originally called "CIFS" or SMB1).7 8The CIFS VFS module for Linux supports many advanced network filesystem9features such as hierarchical DFS like namespace, hardlinks, locking and more.10It was designed to comply with the SNIA CIFS Technical Reference (which11supersedes the 1992 X/Open SMB Standard) as well as to perform best practice12practical interoperability with Windows 2000, Windows XP, Samba and equivalent13servers.  This code was developed in participation with the Protocol Freedom14Information Foundation.  CIFS and now SMB3 has now become a defacto15standard for interoperating between Macs and Windows and major NAS appliances.16 17Please see18MS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification)19or https://samba.org/samba/PFIF/20for more details.21 22 23For questions or bug reports please contact:24 25    smfrench@gmail.com26 27See the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils28 29Build instructions30==================31 32For Linux:33 341) Download the kernel (e.g. from https://www.kernel.org)35   and change directory into the top of the kernel directory tree36   (e.g. /usr/src/linux-2.5.73)372) make menuconfig (or make xconfig)383) select cifs from within the network filesystem choices394) save and exit405) make41 42 43Installation instructions44=========================45 46If you have built the CIFS vfs as module (successfully) simply47type ``make modules_install`` (or if you prefer, manually copy the file to48the modules directory e.g. /lib/modules/6.3.0-060300-generic/kernel/fs/smb/client/cifs.ko).49 50If you have built the CIFS vfs into the kernel itself, follow the instructions51for your distribution on how to install a new kernel (usually you52would simply type ``make install``).53 54If you do not have the utility mount.cifs (in the Samba 4.x source tree and on55the CIFS VFS web site) copy it to the same directory in which mount helpers56reside (usually /sbin).  Although the helper software is not57required, mount.cifs is recommended.  Most distros include a ``cifs-utils``58package that includes this utility so it is recommended to install this.59 60Note that running the Winbind pam/nss module (logon service) on all of your61Linux clients is useful in mapping Uids and Gids consistently across the62domain to the proper network user.  The mount.cifs mount helper can be63found at cifs-utils.git on git.samba.org64 65If cifs is built as a module, then the size and number of network buffers66and maximum number of simultaneous requests to one server can be configured.67Changing these from their defaults is not recommended. By executing modinfo::68 69	modinfo <path to cifs.ko>70 71on kernel/fs/smb/client/cifs.ko the list of configuration changes that can be made72at module initialization time (by running insmod cifs.ko) can be seen.73 74Recommendations75===============76 77To improve security the SMB2.1 dialect or later (usually will get SMB3.1.1) is now78the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0"79on mount (or vers=2.0 for Windows Vista).  Note that the CIFS (vers=1.0) is80much older and less secure than the default dialect SMB3 which includes81many advanced security features such as downgrade attack detection82and encrypted shares and stronger signing and authentication algorithms.83There are additional mount options that may be helpful for SMB3 to get84improved POSIX behavior (NB: can use vers=3 to force SMB3 or later, never 2.1):85 86   ``mfsymlinks`` and either ``cifsacl`` or ``modefromsid`` (usually with ``idsfromsid``)87 88Allowing User Mounts89====================90 91To permit users to mount and unmount over directories they own is possible92with the cifs vfs.  A way to enable such mounting is to mark the mount.cifs93utility as suid (e.g. ``chmod +s /sbin/mount.cifs``). To enable users to94umount shares they mount requires95 961) mount.cifs version 1.4 or later972) an entry for the share in /etc/fstab indicating that a user may98   unmount it e.g.::99 100     //server/usersharename  /mnt/username cifs user 0 0101 102Note that when the mount.cifs utility is run suid (allowing user mounts),103in order to reduce risks, the ``nosuid`` mount flag is passed in on mount to104disallow execution of an suid program mounted on the remote target.105When mount is executed as root, nosuid is not passed in by default,106and execution of suid programs on the remote target would be enabled107by default. This can be changed, as with nfs and other filesystems,108by simply specifying ``nosuid`` among the mount options. For user mounts109though to be able to pass the suid flag to mount requires rebuilding110mount.cifs with the following flag: CIFS_ALLOW_USR_SUID111 112There is a corresponding manual page for cifs mounting in the Samba 3.0 and113later source tree in docs/manpages/mount.cifs.8114 115Allowing User Unmounts116======================117 118To permit users to unmount directories that they have user mounted (see above),119the utility umount.cifs may be used.  It may be invoked directly, or if120umount.cifs is placed in /sbin, umount can invoke the cifs umount helper121(at least for most versions of the umount utility) for umount of cifs122mounts, unless umount is invoked with -i (which will avoid invoking a umount123helper). As with mount.cifs, to enable user unmounts umount.cifs must be marked124as suid (e.g. ``chmod +s /sbin/umount.cifs``) or equivalent (some distributions125allow adding entries to a file to the /etc/permissions file to achieve the126equivalent suid effect).  For this utility to succeed the target path127must be a cifs mount, and the uid of the current user must match the uid128of the user who mounted the resource.129 130Also note that the customary way of allowing user mounts and unmounts is131(instead of using mount.cifs and unmount.cifs as suid) to add a line132to the file /etc/fstab for each //server/share you wish to mount, but133this can become unwieldy when potential mount targets include many134or  unpredictable UNC names.135 136Samba Considerations137====================138 139Most current servers support SMB2.1 and SMB3 which are more secure,140but there are useful protocol extensions for the older less secure CIFS141dialect, so to get the maximum benefit if mounting using the older dialect142(CIFS/SMB1), we recommend using a server that supports the SNIA CIFS143Unix Extensions standard (e.g. almost any  version of Samba ie version1442.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers.145Note that uid, gid and file permissions will display default values if you do146not have a server that supports the Unix extensions for CIFS (such as Samba1472.2.5 or later).  To enable the Unix CIFS Extensions in the Samba server, add148the line::149 150	unix extensions = yes151 152to your smb.conf file on the server.  Note that the following smb.conf settings153are also useful (on the Samba server) when the majority of clients are Unix or154Linux::155 156	case sensitive = yes157	delete readonly = yes158	ea support = yes159 160Note that server ea support is required for supporting xattrs from the Linux161cifs client, and that EA support is present in later versions of Samba (e.g.1623.0.6 and later (also EA support works in all versions of Windows, at least to163shares on NTFS filesystems).  Extended Attribute (xattr) support is an optional164feature of most Linux filesystems which may require enabling via165make menuconfig. Client support for extended attributes (user xattr) can be166disabled on a per-mount basis by specifying ``nouser_xattr`` on mount.167 168The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers169version 3.10 and later.  Setting POSIX ACLs requires enabling both XATTR and170then POSIX support in the CIFS configuration options when building the cifs171module.  POSIX ACL support can be disabled on a per mount basic by specifying172``noacl`` on mount.173 174Some administrators may want to change Samba's smb.conf ``map archive`` and175``create mask`` parameters from the default.  Unless the create mask is changed176newly created files can end up with an unnecessarily restrictive default mode,177which may not be what you want, although if the CIFS Unix extensions are178enabled on the server and client, subsequent setattr calls (e.g. chmod) can179fix the mode.  Note that creating special devices (mknod) remotely180may require specifying a mkdev function to Samba if you are not using181Samba 3.0.6 or later.  For more information on these see the manual pages182(``man smb.conf``) on the Samba server system.  Note that the cifs vfs,183unlike the smbfs vfs, does not read the smb.conf on the client system184(the few optional settings are passed in on mount via -o parameters instead).185Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete186open files (required for strict POSIX compliance).  Windows Servers already187supported this feature. Samba server does not allow symlinks that refer to files188outside of the share, so in Samba versions prior to 3.0.6, most symlinks to189files with absolute paths (ie beginning with slash) such as::190 191	 ln -s /mnt/foo bar192 193would be forbidden. Samba 3.0.6 server or later includes the ability to create194such symlinks safely by converting unsafe symlinks (ie symlinks to server195files that are outside of the share) to a samba specific format on the server196that is ignored by local server applications and non-cifs clients and that will197not be traversed by the Samba server).  This is opaque to the Linux client198application using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or199later, but only for remote clients using the CIFS Unix extensions, and will200be invisible to Windows clients and typically will not affect local201applications running on the same server as Samba.202 203Use instructions204================205 206Once the CIFS VFS support is built into the kernel or installed as a module207(cifs.ko), you can use mount syntax like the following to access Samba or208Mac or Windows servers::209 210  mount -t cifs //9.53.216.11/e$ /mnt -o username=myname,password=mypassword211 212Before -o the option -v may be specified to make the mount.cifs213mount helper display the mount steps more verbosely.214After -o the following commonly used cifs vfs specific options215are supported::216 217  username=<username>218  password=<password>219  domain=<domain name>220 221Other cifs mount options are described below.  Use of TCP names (in addition to222ip addresses) is available if the mount helper (mount.cifs) is installed. If223you do not trust the server to which are mounted, or if you do not have224cifs signing enabled (and the physical network is insecure), consider use225of the standard mount options ``noexec`` and ``nosuid`` to reduce the risk of226running an altered binary on your local system (downloaded from a hostile server227or altered by a hostile router).228 229Although mounting using format corresponding to the CIFS URL specification is230not possible in mount.cifs yet, it is possible to use an alternate format231for the server and sharename (which is somewhat similar to NFS style mount232syntax) instead of the more widely used UNC format (i.e. \\server\share)::233 234  mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswd235 236When using the mount helper mount.cifs, passwords may be specified via alternate237mechanisms, instead of specifying it after -o using the normal ``pass=`` syntax238on the command line:2391) By including it in a credential file. Specify credentials=filename as one240of the mount options. Credential files contain two lines::241 242	username=someuser243	password=your_password244 2452) By specifying the password in the PASSWD environment variable (similarly246   the user name can be taken from the USER environment variable).2473) By specifying the password in a file by name via PASSWD_FILE2484) By specifying the password in a file by file descriptor via PASSWD_FD249 250If no password is provided, mount.cifs will prompt for password entry251 252Restrictions253============254 255Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC2561001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a257problem as most servers support this.258 259Valid filenames differ between Windows and Linux.  Windows typically restricts260filenames which contain certain reserved characters (e.g.the character :261which is used to delimit the beginning of a stream name by Windows), while262Linux allows a slightly wider set of valid characters in filenames. Windows263servers can remap such characters when an explicit mapping is specified in264the Server's registry.  Samba starting with version 3.10 will allow such265filenames (ie those which contain valid Linux characters, which normally266would be forbidden for Windows/CIFS semantics) as long as the server is267configured for Unix Extensions (and the client has not disabled268/proc/fs/cifs/LinuxExtensionsEnabled). In addition the mount option269``mapposix`` can be used on CIFS (vers=1.0) to force the mapping of270illegal Windows/NTFS/SMB characters to a remap range (this mount parameter271is the default for SMB3). This remap (``mapposix``) range is also272compatible with Mac (and "Services for Mac" on some older Windows).273 274CIFS VFS Mount Options275======================276A partial list of the supported mount options follows:277 278  username279		The user name to use when trying to establish280		the CIFS session.281  password282		The user password.  If the mount helper is283		installed, the user will be prompted for password284		if not supplied.285  ip286		The ip address of the target server287  unc288		The target server Universal Network Name (export) to289		mount.290  domain291		Set the SMB/CIFS workgroup name prepended to the292		username during CIFS session establishment293  forceuid294		Set the default uid for inodes to the uid295		passed in on mount. For mounts to servers296		which do support the CIFS Unix extensions, such as a297		properly configured Samba server, the server provides298		the uid, gid and mode so this parameter should not be299		specified unless the server and clients uid and gid300		numbering differ.  If the server and client are in the301		same domain (e.g. running winbind or nss_ldap) and302		the server supports the Unix Extensions then the uid303		and gid can be retrieved from the server (and uid304		and gid would not have to be specified on the mount.305		For servers which do not support the CIFS Unix306		extensions, the default uid (and gid) returned on lookup307		of existing files will be the uid (gid) of the person308		who executed the mount (root, except when mount.cifs309		is configured setuid for user mounts) unless the ``uid=``310		(gid) mount option is specified. Also note that permission311		checks (authorization checks) on accesses to a file occur312		at the server, but there are cases in which an administrator313		may want to restrict at the client as well.  For those314		servers which do not report a uid/gid owner315		(such as Windows), permissions can also be checked at the316		client, and a crude form of client side permission checking317		can be enabled by specifying file_mode and dir_mode on318		the client.  (default)319  forcegid320		(similar to above but for the groupid instead of uid) (default)321  noforceuid322		Fill in file owner information (uid) by requesting it from323		the server if possible. With this option, the value given in324		the uid= option (on mount) will only be used if the server325		can not support returning uids on inodes.326  noforcegid327		(similar to above but for the group owner, gid, instead of uid)328  uid329		Set the default uid for inodes, and indicate to the330		cifs kernel driver which local user mounted. If the server331		supports the unix extensions the default uid is332		not used to fill in the owner fields of inodes (files)333		unless the ``forceuid`` parameter is specified.334  gid335		Set the default gid for inodes (similar to above).336  file_mode337		If CIFS Unix extensions are not supported by the server338		this overrides the default mode for file inodes.339  fsc340		Enable local disk caching using FS-Cache (off by default). This341		option could be useful to improve performance on a slow link,342		heavily loaded server and/or network where reading from the343		disk is faster than reading from the server (over the network).344		This could also impact scalability positively as the345		number of calls to the server are reduced. However, local346		caching is not suitable for all workloads for e.g. read-once347		type workloads. So, you need to consider carefully your348		workload/scenario before using this option. Currently, local349		disk caching is functional for CIFS files opened as read-only.350  dir_mode351		If CIFS Unix extensions are not supported by the server352		this overrides the default mode for directory inodes.353  port354		attempt to contact the server on this tcp port, before355		trying the usual ports (port 445, then 139).356  iocharset357		Codepage used to convert local path names to and from358		Unicode. Unicode is used by default for network path359		names if the server supports it.  If iocharset is360		not specified then the nls_default specified361		during the local client kernel build will be used.362		If server does not support Unicode, this parameter is363		unused.364  rsize365		default read size (usually 16K). The client currently366		can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize367		defaults to 16K and may be changed (from 8K to the maximum368		kmalloc size allowed by your kernel) at module install time369		for cifs.ko. Setting CIFSMaxBufSize to a very large value370		will cause cifs to use more memory and may reduce performance371		in some cases.  To use rsize greater than 127K (the original372		cifs protocol maximum) also requires that the server support373		a new Unix Capability flag (for very large read) which some374		newer servers (e.g. Samba 3.0.26 or later) do. rsize can be375		set from a minimum of 2048 to a maximum of 130048 (127K or376		CIFSMaxBufSize, whichever is smaller)377  wsize378		default write size (default 57344)379		maximum wsize currently allowed by CIFS is 57344 (fourteen380		4096 byte pages)381  actimeo=n382		attribute cache timeout in seconds (default 1 second).383		After this timeout, the cifs client requests fresh attribute384		information from the server. This option allows to tune the385		attribute cache timeout to suit the workload needs. Shorter386		timeouts mean better the cache coherency, but increased number387		of calls to the server. Longer timeouts mean reduced number388		of calls to the server at the expense of less stricter cache389		coherency checks (i.e. incorrect attribute cache for a short390		period of time).391  rw392		mount the network share read-write (note that the393		server may still consider the share read-only)394  ro395		mount network share read-only396  version397		used to distinguish different versions of the398		mount helper utility (not typically needed)399  sep400		if first mount option (after the -o), overrides401		the comma as the separator between the mount402		parameters. e.g.::403 404			-o user=myname,password=mypassword,domain=mydom405 406		could be passed instead with period as the separator by::407 408			-o sep=.user=myname.password=mypassword.domain=mydom409 410		this might be useful when comma is contained within username411		or password or domain. This option is less important412		when the cifs mount helper cifs.mount (version 1.1 or later)413		is used.414  nosuid415		Do not allow remote executables with the suid bit416		program to be executed.  This is only meaningful for mounts417		to servers such as Samba which support the CIFS Unix Extensions.418		If you do not trust the servers in your network (your mount419		targets) it is recommended that you specify this option for420		greater security.421  exec422		Permit execution of binaries on the mount.423  noexec424		Do not permit execution of binaries on the mount.425  dev426		Recognize block devices on the remote mount.427  nodev428		Do not recognize devices on the remote mount.429  suid430		Allow remote files on this mountpoint with suid enabled to431		be executed (default for mounts when executed as root,432		nosuid is default for user mounts).433  credentials434		Although ignored by the cifs kernel component, it is used by435		the mount helper, mount.cifs. When mount.cifs is installed it436		opens and reads the credential file specified in order437		to obtain the userid and password arguments which are passed to438		the cifs vfs.439  guest440		Although ignored by the kernel component, the mount.cifs441		mount helper will not prompt the user for a password442		if guest is specified on the mount options.  If no443		password is specified a null password will be used.444  perm445		Client does permission checks (vfs_permission check of uid446		and gid of the file against the mode and desired operation),447		Note that this is in addition to the normal ACL check on the448		target machine done by the server software.449		Client permission checking is enabled by default.450  noperm451		Client does not do permission checks.  This can expose452		files on this mount to access by other users on the local453		client system. It is typically only needed when the server454		supports the CIFS Unix Extensions but the UIDs/GIDs on the455		client and server system do not match closely enough to allow456		access by the user doing the mount, but it may be useful with457		non CIFS Unix Extension mounts for cases in which the default458		mode is specified on the mount but is not to be enforced on the459		client (e.g. perhaps when MultiUserMount is enabled)460		Note that this does not affect the normal ACL check on the461		target machine done by the server software (of the server462		ACL against the user name provided at mount time).463  serverino464		Use server's inode numbers instead of generating automatically465		incrementing inode numbers on the client.  Although this will466		make it easier to spot hardlinked files (as they will have467		the same inode numbers) and inode numbers may be persistent,468		note that the server does not guarantee that the inode numbers469		are unique if multiple server side mounts are exported under a470		single share (since inode numbers on the servers might not471		be unique if multiple filesystems are mounted under the same472		shared higher level directory).  Note that some older473		(e.g. pre-Windows 2000) do not support returning UniqueIDs474		or the CIFS Unix Extensions equivalent and for those475		this mount option will have no effect.  Exporting cifs mounts476		under nfsd requires this mount option on the cifs mount.477		This is now the default if server supports the478		required network operation.479  noserverino480		Client generates inode numbers (rather than using the actual one481		from the server). These inode numbers will vary after482		unmount or reboot which can confuse some applications,483		but not all server filesystems support unique inode484		numbers.485  setuids486		If the CIFS Unix extensions are negotiated with the server487		the client will attempt to set the effective uid and gid of488		the local process on newly created files, directories, and489		devices (create, mkdir, mknod).  If the CIFS Unix Extensions490		are not negotiated, for newly created files and directories491		instead of using the default uid and gid specified on492		the mount, cache the new file's uid and gid locally which means493		that the uid for the file can change when the inode is494		reloaded (or the user remounts the share).495  nosetuids496		The client will not attempt to set the uid and gid on497		on newly created files, directories, and devices (create,498		mkdir, mknod) which will result in the server setting the499		uid and gid to the default (usually the server uid of the500		user who mounted the share).  Letting the server (rather than501		the client) set the uid and gid is the default. If the CIFS502		Unix Extensions are not negotiated then the uid and gid for503		new files will appear to be the uid (gid) of the mounter or the504		uid (gid) parameter specified on the mount.505  netbiosname506		When mounting to servers via port 139, specifies the RFC1001507		source name to use to represent the client netbios machine508		name when doing the RFC1001 netbios session initialize.509  direct510		Do not do inode data caching on files opened on this mount.511		This precludes mmapping files on this mount. In some cases512		with fast networks and little or no caching benefits on the513		client (e.g. when the application is doing large sequential514		reads bigger than page size without rereading the same data)515		this can provide better performance than the default516		behavior which caches reads (readahead) and writes517		(writebehind) through the local Linux client pagecache518		if oplock (caching token) is granted and held. Note that519		direct allows write operations larger than page size520		to be sent to the server.521  strictcache522		Use for switching on strict cache mode. In this mode the523		client read from the cache all the time it has Oplock Level II,524		otherwise - read from the server. All written data are stored525		in the cache, but if the client doesn't have Exclusive Oplock,526		it writes the data to the server.527  rwpidforward528		Forward pid of a process who opened a file to any read or write529		operation on that file. This prevent applications like WINE530		from failing on read and write if we use mandatory brlock style.531  acl532		Allow setfacl and getfacl to manage posix ACLs if server533		supports them.  (default)534  noacl535		Do not allow setfacl and getfacl calls on this mount536  user_xattr537		Allow getting and setting user xattrs (those attributes whose538		name begins with ``user.`` or ``os2.``) as OS/2 EAs (extended539		attributes) to the server.  This allows support of the540		setfattr and getfattr utilities. (default)541  nouser_xattr542		Do not allow getfattr/setfattr to get/set/list xattrs543  mapchars544		Translate six of the seven reserved characters (not backslash)::545 546			*?<>|:547 548		to the remap range (above 0xF000), which also549		allows the CIFS client to recognize files created with550		such characters by Windows's POSIX emulation. This can551		also be useful when mounting to most versions of Samba552		(which also forbids creating and opening files553		whose names contain any of these seven characters).554		This has no effect if the server does not support555		Unicode on the wire.556  nomapchars557		Do not translate any of these seven characters (default).558  nocase559		Request case insensitive path name matching (case560		sensitive is the default if the server supports it).561		(mount option ``ignorecase`` is identical to ``nocase``)562  posixpaths563		If CIFS Unix extensions are supported, attempt to564		negotiate posix path name support which allows certain565		characters forbidden in typical CIFS filenames, without566		requiring remapping. (default)567  noposixpaths568		If CIFS Unix extensions are supported, do not request569		posix path name support (this may cause servers to570		reject creatingfile with certain reserved characters).571  nounix572		Disable the CIFS Unix Extensions for this mount (tree573		connection). This is rarely needed, but it may be useful574		in order to turn off multiple settings all at once (ie575		posix acls, posix locks, posix paths, symlink support576		and retrieving uids/gids/mode from the server) or to577		work around a bug in server which implement the Unix578		Extensions.579  nobrl580		Do not send byte range lock requests to the server.581		This is necessary for certain applications that break582		with cifs style mandatory byte range locks (and most583		cifs servers do not yet support requesting advisory584		byte range locks).585  forcemandatorylock586		Even if the server supports posix (advisory) byte range587		locking, send only mandatory lock requests.  For some588		(presumably rare) applications, originally coded for589		DOS/Windows, which require Windows style mandatory byte range590		locking, they may be able to take advantage of this option,591		forcing the cifs client to only send mandatory locks592		even if the cifs server would support posix advisory locks.593		``forcemand`` is accepted as a shorter form of this mount594		option.595  nostrictsync596		If this mount option is set, when an application does an597		fsync call then the cifs client does not send an SMB Flush598		to the server (to force the server to write all dirty data599		for this file immediately to disk), although cifs still sends600		all dirty (cached) file data to the server and waits for the601		server to respond to the write.  Since SMB Flush can be602		very slow, and some servers may be reliable enough (to risk603		delaying slightly flushing the data to disk on the server),604		turning on this option may be useful to improve performance for605		applications that fsync too much, at a small risk of server606		crash.  If this mount option is not set, by default cifs will607		send an SMB flush request (and wait for a response) on every608		fsync call.609  nodfs610		Disable DFS (global name space support) even if the611		server claims to support it.  This can help work around612		a problem with parsing of DFS paths with Samba server613		versions 3.0.24 and 3.0.25.614  remount615		remount the share (often used to change from ro to rw mounts616		or vice versa)617  cifsacl618		Report mode bits (e.g. on stat) based on the Windows ACL for619		the file. (EXPERIMENTAL)620  servern621		Specify the server 's netbios name (RFC1001 name) to use622		when attempting to setup a session to the server.623		This is needed for mounting to some older servers (such624		as OS/2 or Windows 98 and Windows ME) since they do not625		support a default server name.  A server name can be up626		to 15 characters long and is usually uppercased.627  sfu628		When the CIFS Unix Extensions are not negotiated, attempt to629		create device files and fifos in a format compatible with630		Services for Unix (SFU).  In addition retrieve bits 10-12631		of the mode via the SETFILEBITS extended attribute (as632		SFU does).  In the future the bottom 9 bits of the633		mode also will be emulated using queries of the security634		descriptor (ACL).635  mfsymlinks636		Enable support for Minshall+French symlinks637		(see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks)638		This option is ignored when specified together with the639		'sfu' option. Minshall+French symlinks are used even if640		the server supports the CIFS Unix Extensions.641  sign642		Must use packet signing (helps avoid unwanted data modification643		by intermediate systems in the route).  Note that signing644		does not work with lanman or plaintext authentication.645  seal646		Must seal (encrypt) all data on this mounted share before647		sending on the network.  Requires support for Unix Extensions.648		Note that this differs from the sign mount option in that it649		causes encryption of data sent over this mounted share but other650		shares mounted to the same server are unaffected.651  locallease652		This option is rarely needed. Fcntl F_SETLEASE is653		used by some applications such as Samba and NFSv4 server to654		check to see whether a file is cacheable.  CIFS has no way655		to explicitly request a lease, but can check whether a file656		is cacheable (oplocked).  Unfortunately, even if a file657		is not oplocked, it could still be cacheable (ie cifs client658		could grant fcntl leases if no other local processes are using659		the file) for cases for example such as when the server does not660		support oplocks and the user is sure that the only updates to661		the file will be from this client. Specifying this mount option662		will allow the cifs client to check for leases (only) locally663		for files which are not oplocked instead of denying leases664		in that case. (EXPERIMENTAL)665  sec666		Security mode.  Allowed values are:667 668			none669				attempt to connection as a null user (no name)670			krb5671				Use Kerberos version 5 authentication672			krb5i673				Use Kerberos authentication and packet signing674			ntlm675				Use NTLM password hashing (default)676			ntlmi677				Use NTLM password hashing with signing (if678				/proc/fs/cifs/PacketSigningEnabled on or if679				server requires signing also can be the default)680			ntlmv2681				Use NTLMv2 password hashing682			ntlmv2i683				Use NTLMv2 password hashing with packet signing684			lanman685				(if configured in kernel config) use older686				lanman hash687  hard688		Retry file operations if server is not responding689  soft690		Limit retries to unresponsive servers (usually only691		one retry) before returning an error.  (default)692 693The mount.cifs mount helper also accepts a few mount options before -o694including:695 696=============== ===============================================================697	-S      take password from stdin (equivalent to setting the environment698		variable ``PASSWD_FD=0``699	-V      print mount.cifs version700	-?      display simple usage information701=============== ===============================================================702 703With most 2.6 kernel versions of modutils, the version of the cifs kernel704module can be displayed via modinfo.705 706Misc /proc/fs/cifs Flags and Debug Info707=======================================708 709Informational pseudo-files:710 711======================= =======================================================712DebugData		Displays information about active CIFS sessions and713			shares, features enabled as well as the cifs.ko714			version.715Stats			Lists summary resource usage information as well as per716			share statistics.717open_files		List all the open file handles on all active SMB sessions.718mount_params            List of all mount parameters available for the module719======================= =======================================================720 721Configuration pseudo-files:722 723======================= =======================================================724SecurityFlags		Flags which control security negotiation and725			also packet signing. Authentication (may/must)726			flags (e.g. for NTLMv2) may be combined with727			the signing flags.  Specifying two different password728			hashing mechanisms (as "must use") on the other hand729			does not make much sense. Default flags are::730 731				0x00C5732 733			(NTLMv2 and packet signing allowed).  Some SecurityFlags734			may require enabling a corresponding menuconfig option.735 736			  may use packet signing			0x00001737			  must use packet signing			0x01001738			  may use NTLMv2				0x00004739			  must use NTLMv2				0x04004740			  may use Kerberos security (krb5)		0x00008741			  must use Kerberos                             0x08008742			  may use NTLMSSP               		0x00080743			  must use NTLMSSP           			0x80080744			  seal (packet encryption)			0x00040745			  must seal                                     0x40040746 747cifsFYI			If set to non-zero value, additional debug information748			will be logged to the system error log.  This field749			contains three flags controlling different classes of750			debugging entries.  The maximum value it can be set751			to is 7 which enables all debugging points (default 0).752			Some debugging statements are not compiled into the753			cifs kernel unless CONFIG_CIFS_DEBUG2 is enabled in the754			kernel configuration. cifsFYI may be set to one or755			more of the following flags (7 sets them all)::756 757			  +-----------------------------------------------+------+758			  | log cifs informational messages		  | 0x01 |759			  +-----------------------------------------------+------+760			  | log return codes from cifs entry points	  | 0x02 |761			  +-----------------------------------------------+------+762			  | log slow responses				  | 0x04 |763			  | (ie which take longer than 1 second)	  |      |764			  |                                               |      |765			  | CONFIG_CIFS_STATS2 must be enabled in .config |      |766			  +-----------------------------------------------+------+767 768traceSMB		If set to one, debug information is logged to the769			system error log with the start of smb requests770			and responses (default 0)771LookupCacheEnable	If set to one, inode information is kept cached772			for one second improving performance of lookups773			(default 1)774LinuxExtensionsEnabled	If set to one then the client will attempt to775			use the CIFS "UNIX" extensions which are optional776			protocol enhancements that allow CIFS servers777			to return accurate UID/GID information as well778			as support symbolic links. If you use servers779			such as Samba that support the CIFS Unix780			extensions but do not want to use symbolic link781			support and want to map the uid and gid fields782			to values supplied at mount (rather than the783			actual values, then set this to zero. (default 1)784dfscache		List the content of the DFS cache.785			If set to 0, the client will clear the cache.786======================= =======================================================787 788These experimental features and tracing can be enabled by changing flags in789/proc/fs/cifs (after the cifs module has been installed or built into the790kernel, e.g.  insmod cifs).  To enable a feature set it to 1 e.g.  to enable791tracing to the kernel message log type::792 793	echo 7 > /proc/fs/cifs/cifsFYI794 795cifsFYI functions as a bit mask. Setting it to 1 enables additional kernel796logging of various informational messages.  2 enables logging of non-zero797SMB return codes while 4 enables logging of requests that take longer798than one second to complete (except for byte range lock requests).799Setting it to 4 requires CONFIG_CIFS_STATS2 to be set in kernel configuration800(.config). Setting it to seven enables all three.  Finally, tracing801the start of smb requests and responses can be enabled via::802 803	echo 1 > /proc/fs/cifs/traceSMB804 805Per share (per client mount) statistics are available in /proc/fs/cifs/Stats.806Additional information is available if CONFIG_CIFS_STATS2 is enabled in the807kernel configuration (.config).  The statistics returned include counters which808represent the number of attempted and failed (ie non-zero return code from the809server) SMB3 (or cifs) requests grouped by request type (read, write, close etc.).810Also recorded is the total bytes read and bytes written to the server for811that share.  Note that due to client caching effects this can be less than the812number of bytes read and written by the application running on the client.813Statistics can be reset to zero by ``echo 0 > /proc/fs/cifs/Stats`` which may be814useful if comparing performance of two different scenarios.815 816Also note that ``cat /proc/fs/cifs/DebugData`` will display information about817the active sessions and the shares that are mounted.818 819Enabling Kerberos (extended security) works but requires version 1.2 or later820of the helper program cifs.upcall to be present and to be configured in the821/etc/request-key.conf file.  The cifs.upcall helper program is from the Samba822project(https://www.samba.org). NTLM and NTLMv2 and LANMAN support do not823require this helper. Note that NTLMv2 security (which does not require the824cifs.upcall helper program), instead of using Kerberos, is sufficient for825some use cases.826 827DFS support allows transparent redirection to shares in an MS-DFS name space.828In addition, DFS support for target shares which are specified as UNC829names which begin with host names (rather than IP addresses) requires830a user space helper (such as cifs.upcall) to be present in order to831translate host names to ip address, and the user space helper must also832be configured in the file /etc/request-key.conf.  Samba, Windows servers and833many NAS appliances support DFS as a way of constructing a global name834space to ease network configuration and improve reliability.835 836To use cifs Kerberos and DFS support, the Linux keyutils package should be837installed and something like the following lines should be added to the838/etc/request-key.conf file::839 840  create cifs.spnego * * /usr/local/sbin/cifs.upcall %k841  create dns_resolver * * /usr/local/sbin/cifs.upcall %k842 843CIFS kernel module parameters844=============================845These module parameters can be specified or modified either during the time of846module loading or during the runtime by using the interface::847 848	/sys/module/cifs/parameters/<param>849 850i.e.::851 852    echo "value" > /sys/module/cifs/parameters/<param>853 854More detailed descriptions of the available module parameters and their values855can be seen by doing:856 857    modinfo cifs (or modinfo smb3)858 859================= ==========================================================8601. enable_oplocks Enable or disable oplocks. Oplocks are enabled by default.861		  [Y/y/1]. To disable use any of [N/n/0].862================= ==========================================================863