1f139291cSMauro Carvalho Chehab===== 2f139291cSMauro Carvalho ChehabUsage 3f139291cSMauro Carvalho Chehab===== 4f139291cSMauro Carvalho Chehab 5ec11653bSSteve FrenchThis module supports the SMB3 family of advanced network protocols (as well 6ec11653bSSteve Frenchas older dialects, originally called "CIFS" or SMB1). 7ec11653bSSteve French 8ec11653bSSteve FrenchThe CIFS VFS module for Linux supports many advanced network filesystem 9ec11653bSSteve Frenchfeatures such as hierarchical DFS like namespace, hardlinks, locking and more. 101da177e4SLinus TorvaldsIt was designed to comply with the SNIA CIFS Technical Reference (which 111da177e4SLinus Torvaldssupersedes the 1992 X/Open SMB Standard) as well as to perform best practice 121da177e4SLinus Torvaldspractical interoperability with Windows 2000, Windows XP, Samba and equivalent 13675c4679SSteve Frenchservers. This code was developed in participation with the Protocol Freedom 14ec11653bSSteve FrenchInformation Foundation. CIFS and now SMB3 has now become a defacto 15ec11653bSSteve Frenchstandard for interoperating between Macs and Windows and major NAS appliances. 16675c4679SSteve French 17675c4679SSteve FrenchPlease see 18f30e4148SSteve FrenchMS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification) 1902030eb7SJonathan Corbetor https://samba.org/samba/PFIF/ 20675c4679SSteve Frenchfor more details. 21675c4679SSteve French 221da177e4SLinus Torvalds 231da177e4SLinus TorvaldsFor questions or bug reports please contact: 24f139291cSMauro Carvalho Chehab 25f30e4148SSteve French smfrench@gmail.com 261da177e4SLinus Torvalds 27ec11653bSSteve FrenchSee the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils 28ec11653bSSteve French 29f139291cSMauro Carvalho ChehabBuild instructions 301da177e4SLinus Torvalds================== 31f139291cSMauro Carvalho Chehab 32ec11653bSSteve FrenchFor Linux: 33f139291cSMauro Carvalho Chehab 34cba22b1cSAlexander A. Klimov1) Download the kernel (e.g. from https://www.kernel.org) 35dfc1e148SAdrian Bunk and change directory into the top of the kernel directory tree 36dfc1e148SAdrian Bunk (e.g. /usr/src/linux-2.5.73) 371da177e4SLinus Torvalds2) make menuconfig (or make xconfig) 381da177e4SLinus Torvalds3) select cifs from within the network filesystem choices 391da177e4SLinus Torvalds4) save and exit 401da177e4SLinus Torvalds5) make 411da177e4SLinus Torvalds 421da177e4SLinus Torvalds 43f139291cSMauro Carvalho ChehabInstallation instructions 441da177e4SLinus Torvalds========================= 45f139291cSMauro Carvalho Chehab 461da177e4SLinus TorvaldsIf you have built the CIFS vfs as module (successfully) simply 47f139291cSMauro Carvalho Chehabtype ``make modules_install`` (or if you prefer, manually copy the file to 48bf8a352dSSteve Frenchthe modules directory e.g. /lib/modules/6.3.0-060300-generic/kernel/fs/smb/client/cifs.ko). 491da177e4SLinus Torvalds 501da177e4SLinus TorvaldsIf you have built the CIFS vfs into the kernel itself, follow the instructions 511da177e4SLinus Torvaldsfor your distribution on how to install a new kernel (usually you 52f139291cSMauro Carvalho Chehabwould simply type ``make install``). 531da177e4SLinus Torvalds 54f30e4148SSteve FrenchIf you do not have the utility mount.cifs (in the Samba 4.x source tree and on 55f30e4148SSteve Frenchthe CIFS VFS web site) copy it to the same directory in which mount helpers 56f30e4148SSteve Frenchreside (usually /sbin). Although the helper software is not 57f139291cSMauro Carvalho Chehabrequired, mount.cifs is recommended. Most distros include a ``cifs-utils`` 58ec11653bSSteve Frenchpackage that includes this utility so it is recommended to install this. 59ec11653bSSteve French 601da177e4SLinus TorvaldsNote that running the Winbind pam/nss module (logon service) on all of your 611da177e4SLinus TorvaldsLinux clients is useful in mapping Uids and Gids consistently across the 621da177e4SLinus Torvaldsdomain to the proper network user. The mount.cifs mount helper can be 63ec11653bSSteve Frenchfound at cifs-utils.git on git.samba.org 641da177e4SLinus Torvalds 651da177e4SLinus TorvaldsIf cifs is built as a module, then the size and number of network buffers 661da177e4SLinus Torvaldsand maximum number of simultaneous requests to one server can be configured. 67f139291cSMauro Carvalho ChehabChanging these from their defaults is not recommended. By executing modinfo:: 68f139291cSMauro Carvalho Chehab 69bf8a352dSSteve French modinfo <path to cifs.ko> 70f139291cSMauro Carvalho Chehab 71bf8a352dSSteve Frenchon kernel/fs/smb/client/cifs.ko the list of configuration changes that can be made 721da177e4SLinus Torvaldsat module initialization time (by running insmod cifs.ko) can be seen. 731da177e4SLinus Torvalds 74ec11653bSSteve FrenchRecommendations 75ec11653bSSteve French=============== 76f139291cSMauro Carvalho Chehab 77bf8a352dSSteve FrenchTo improve security the SMB2.1 dialect or later (usually will get SMB3.1.1) is now 78ec11653bSSteve Frenchthe new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0" 79ec11653bSSteve Frenchon mount (or vers=2.0 for Windows Vista). Note that the CIFS (vers=1.0) is 80ec11653bSSteve Frenchmuch older and less secure than the default dialect SMB3 which includes 81ec11653bSSteve Frenchmany advanced security features such as downgrade attack detection 82ec11653bSSteve Frenchand encrypted shares and stronger signing and authentication algorithms. 83ec11653bSSteve FrenchThere are additional mount options that may be helpful for SMB3 to get 84*d7851dc1SSteve Frenchimproved POSIX behavior (NB: can use vers=3 to force SMB3 or later, never 2.1): 85f139291cSMauro Carvalho Chehab 86731ddc09SSteve French ``mfsymlinks`` and either ``cifsacl`` or ``modefromsid`` (usually with ``idsfromsid``) 87ec11653bSSteve French 881da177e4SLinus TorvaldsAllowing User Mounts 891da177e4SLinus Torvalds==================== 90f139291cSMauro Carvalho Chehab 911da177e4SLinus TorvaldsTo permit users to mount and unmount over directories they own is possible 921da177e4SLinus Torvaldswith the cifs vfs. A way to enable such mounting is to mark the mount.cifs 93f139291cSMauro Carvalho Chehabutility as suid (e.g. ``chmod +s /sbin/mount.cifs``). To enable users to 941da177e4SLinus Torvaldsumount shares they mount requires 95f139291cSMauro Carvalho Chehab 961da177e4SLinus Torvalds1) mount.cifs version 1.4 or later 971da177e4SLinus Torvalds2) an entry for the share in /etc/fstab indicating that a user may 98f139291cSMauro Carvalho Chehab unmount it e.g.:: 99f139291cSMauro Carvalho Chehab 1001da177e4SLinus Torvalds //server/usersharename /mnt/username cifs user 0 0 1011da177e4SLinus Torvalds 1021da177e4SLinus TorvaldsNote that when the mount.cifs utility is run suid (allowing user mounts), 103f139291cSMauro Carvalho Chehabin order to reduce risks, the ``nosuid`` mount flag is passed in on mount to 1041da177e4SLinus Torvaldsdisallow execution of an suid program mounted on the remote target. 1051da177e4SLinus TorvaldsWhen mount is executed as root, nosuid is not passed in by default, 1061da177e4SLinus Torvaldsand execution of suid programs on the remote target would be enabled 1071da177e4SLinus Torvaldsby default. This can be changed, as with nfs and other filesystems, 108f139291cSMauro Carvalho Chehabby simply specifying ``nosuid`` among the mount options. For user mounts 1091da177e4SLinus Torvaldsthough to be able to pass the suid flag to mount requires rebuilding 110ec11653bSSteve Frenchmount.cifs with the following flag: CIFS_ALLOW_USR_SUID 1111da177e4SLinus Torvalds 1121da177e4SLinus TorvaldsThere is a corresponding manual page for cifs mounting in the Samba 3.0 and 1131da177e4SLinus Torvaldslater source tree in docs/manpages/mount.cifs.8 1141da177e4SLinus Torvalds 115099a58f6SSteve FrenchAllowing User Unmounts 116099a58f6SSteve French====================== 117f139291cSMauro Carvalho Chehab 118b2105aa2SAndrew KlychkovTo permit users to unmount directories that they have user mounted (see above), 119099a58f6SSteve Frenchthe utility umount.cifs may be used. It may be invoked directly, or if 1200cb766aeSSteve Frenchumount.cifs is placed in /sbin, umount can invoke the cifs umount helper 121099a58f6SSteve French(at least for most versions of the umount utility) for umount of cifs 1220cb766aeSSteve Frenchmounts, unless umount is invoked with -i (which will avoid invoking a umount 1230cb766aeSSteve Frenchhelper). As with mount.cifs, to enable user unmounts umount.cifs must be marked 124f139291cSMauro Carvalho Chehabas suid (e.g. ``chmod +s /sbin/umount.cifs``) or equivalent (some distributions 1250cb766aeSSteve Frenchallow adding entries to a file to the /etc/permissions file to achieve the 1260cb766aeSSteve Frenchequivalent suid effect). For this utility to succeed the target path 1270cb766aeSSteve Frenchmust be a cifs mount, and the uid of the current user must match the uid 1280cb766aeSSteve Frenchof the user who mounted the resource. 129099a58f6SSteve French 130099a58f6SSteve FrenchAlso note that the customary way of allowing user mounts and unmounts is 131099a58f6SSteve French(instead of using mount.cifs and unmount.cifs as suid) to add a line 132099a58f6SSteve Frenchto the file /etc/fstab for each //server/share you wish to mount, but 133099a58f6SSteve Frenchthis can become unwieldy when potential mount targets include many 134099a58f6SSteve Frenchor unpredictable UNC names. 135099a58f6SSteve French 1361da177e4SLinus TorvaldsSamba Considerations 1371da177e4SLinus Torvalds==================== 138f139291cSMauro Carvalho Chehab 139f30e4148SSteve FrenchMost current servers support SMB2.1 and SMB3 which are more secure, 140f30e4148SSteve Frenchbut there are useful protocol extensions for the older less secure CIFS 141f30e4148SSteve Frenchdialect, so to get the maximum benefit if mounting using the older dialect 142f30e4148SSteve French(CIFS/SMB1), we recommend using a server that supports the SNIA CIFS 143f30e4148SSteve FrenchUnix Extensions standard (e.g. almost any version of Samba ie version 144f30e4148SSteve French2.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers. 1451da177e4SLinus TorvaldsNote that uid, gid and file permissions will display default values if you do 1461da177e4SLinus Torvaldsnot have a server that supports the Unix extensions for CIFS (such as Samba 1471da177e4SLinus Torvalds2.2.5 or later). To enable the Unix CIFS Extensions in the Samba server, add 148f139291cSMauro Carvalho Chehabthe line:: 1491da177e4SLinus Torvalds 1501da177e4SLinus Torvalds unix extensions = yes 1511da177e4SLinus Torvalds 1521da177e4SLinus Torvaldsto your smb.conf file on the server. Note that the following smb.conf settings 1531da177e4SLinus Torvaldsare also useful (on the Samba server) when the majority of clients are Unix or 154f139291cSMauro Carvalho ChehabLinux:: 1551da177e4SLinus Torvalds 1561da177e4SLinus Torvalds case sensitive = yes 1571da177e4SLinus Torvalds delete readonly = yes 1581da177e4SLinus Torvalds ea support = yes 1591da177e4SLinus Torvalds 1601da177e4SLinus TorvaldsNote that server ea support is required for supporting xattrs from the Linux 1611da177e4SLinus Torvaldscifs client, and that EA support is present in later versions of Samba (e.g. 1621da177e4SLinus Torvalds3.0.6 and later (also EA support works in all versions of Windows, at least to 1631da177e4SLinus Torvaldsshares on NTFS filesystems). Extended Attribute (xattr) support is an optional 1641da177e4SLinus Torvaldsfeature of most Linux filesystems which may require enabling via 1651da177e4SLinus Torvaldsmake menuconfig. Client support for extended attributes (user xattr) can be 166f139291cSMauro Carvalho Chehabdisabled on a per-mount basis by specifying ``nouser_xattr`` on mount. 1671da177e4SLinus Torvalds 1681da177e4SLinus TorvaldsThe CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers 1691da177e4SLinus Torvaldsversion 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and 1701da177e4SLinus Torvaldsthen POSIX support in the CIFS configuration options when building the cifs 1711da177e4SLinus Torvaldsmodule. POSIX ACL support can be disabled on a per mount basic by specifying 172f139291cSMauro Carvalho Chehab``noacl`` on mount. 1731da177e4SLinus Torvalds 174f139291cSMauro Carvalho ChehabSome administrators may want to change Samba's smb.conf ``map archive`` and 175f139291cSMauro Carvalho Chehab``create mask`` parameters from the default. Unless the create mask is changed 1761da177e4SLinus Torvaldsnewly created files can end up with an unnecessarily restrictive default mode, 1771da177e4SLinus Torvaldswhich may not be what you want, although if the CIFS Unix extensions are 1781da177e4SLinus Torvaldsenabled on the server and client, subsequent setattr calls (e.g. chmod) can 1791da177e4SLinus Torvaldsfix the mode. Note that creating special devices (mknod) remotely 1801da177e4SLinus Torvaldsmay require specifying a mkdev function to Samba if you are not using 1811da177e4SLinus TorvaldsSamba 3.0.6 or later. For more information on these see the manual pages 182f139291cSMauro Carvalho Chehab(``man smb.conf``) on the Samba server system. Note that the cifs vfs, 1831da177e4SLinus Torvaldsunlike the smbfs vfs, does not read the smb.conf on the client system 1841da177e4SLinus Torvalds(the few optional settings are passed in on mount via -o parameters instead). 1851da177e4SLinus TorvaldsNote that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete 1861da177e4SLinus Torvaldsopen files (required for strict POSIX compliance). Windows Servers already 1871da177e4SLinus Torvaldssupported this feature. Samba server does not allow symlinks that refer to files 1881da177e4SLinus Torvaldsoutside of the share, so in Samba versions prior to 3.0.6, most symlinks to 189f139291cSMauro Carvalho Chehabfiles with absolute paths (ie beginning with slash) such as:: 190f139291cSMauro Carvalho Chehab 1911da177e4SLinus Torvalds ln -s /mnt/foo bar 192f139291cSMauro Carvalho Chehab 1931da177e4SLinus Torvaldswould be forbidden. Samba 3.0.6 server or later includes the ability to create 1941da177e4SLinus Torvaldssuch symlinks safely by converting unsafe symlinks (ie symlinks to server 1951da177e4SLinus Torvaldsfiles that are outside of the share) to a samba specific format on the server 1961da177e4SLinus Torvaldsthat is ignored by local server applications and non-cifs clients and that will 1971da177e4SLinus Torvaldsnot be traversed by the Samba server). This is opaque to the Linux client 1981da177e4SLinus Torvaldsapplication using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or 1991da177e4SLinus Torvaldslater, but only for remote clients using the CIFS Unix extensions, and will 200b2105aa2SAndrew Klychkovbe invisible to Windows clients and typically will not affect local 2011da177e4SLinus Torvaldsapplications running on the same server as Samba. 2021da177e4SLinus Torvalds 203f139291cSMauro Carvalho ChehabUse instructions 2041da177e4SLinus Torvalds================ 205f139291cSMauro Carvalho Chehab 2061da177e4SLinus TorvaldsOnce the CIFS VFS support is built into the kernel or installed as a module 207ec11653bSSteve French(cifs.ko), you can use mount syntax like the following to access Samba or 208f139291cSMauro Carvalho ChehabMac or Windows servers:: 2091da177e4SLinus Torvalds 210ec11653bSSteve French mount -t cifs //9.53.216.11/e$ /mnt -o username=myname,password=mypassword 2111da177e4SLinus Torvalds 2121da177e4SLinus TorvaldsBefore -o the option -v may be specified to make the mount.cifs 2131da177e4SLinus Torvaldsmount helper display the mount steps more verbosely. 2141da177e4SLinus TorvaldsAfter -o the following commonly used cifs vfs specific options 215f139291cSMauro Carvalho Chehabare supported:: 2161da177e4SLinus Torvalds 217ec11653bSSteve French username=<username> 218ec11653bSSteve French password=<password> 2191da177e4SLinus Torvalds domain=<domain name> 2201da177e4SLinus Torvalds 2211da177e4SLinus TorvaldsOther cifs mount options are described below. Use of TCP names (in addition to 2221da177e4SLinus Torvaldsip addresses) is available if the mount helper (mount.cifs) is installed. If 2231da177e4SLinus Torvaldsyou do not trust the server to which are mounted, or if you do not have 2241da177e4SLinus Torvaldscifs signing enabled (and the physical network is insecure), consider use 225f139291cSMauro Carvalho Chehabof the standard mount options ``noexec`` and ``nosuid`` to reduce the risk of 2261da177e4SLinus Torvaldsrunning an altered binary on your local system (downloaded from a hostile server 2271da177e4SLinus Torvaldsor altered by a hostile router). 2281da177e4SLinus Torvalds 2291da177e4SLinus TorvaldsAlthough mounting using format corresponding to the CIFS URL specification is 2301da177e4SLinus Torvaldsnot possible in mount.cifs yet, it is possible to use an alternate format 2311da177e4SLinus Torvaldsfor the server and sharename (which is somewhat similar to NFS style mount 232f139291cSMauro Carvalho Chehabsyntax) instead of the more widely used UNC format (i.e. \\server\share):: 233f139291cSMauro Carvalho Chehab 2341da177e4SLinus Torvalds mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswd 2351da177e4SLinus Torvalds 2361da177e4SLinus TorvaldsWhen using the mount helper mount.cifs, passwords may be specified via alternate 237f139291cSMauro Carvalho Chehabmechanisms, instead of specifying it after -o using the normal ``pass=`` syntax 2381da177e4SLinus Torvaldson the command line: 2391da177e4SLinus Torvalds1) By including it in a credential file. Specify credentials=filename as one 240f139291cSMauro Carvalho Chehabof the mount options. Credential files contain two lines:: 241f139291cSMauro Carvalho Chehab 2421da177e4SLinus Torvalds username=someuser 2431da177e4SLinus Torvalds password=your_password 244f139291cSMauro Carvalho Chehab 2451da177e4SLinus Torvalds2) By specifying the password in the PASSWD environment variable (similarly 2461da177e4SLinus Torvalds the user name can be taken from the USER environment variable). 2471da177e4SLinus Torvalds3) By specifying the password in a file by name via PASSWD_FILE 2481da177e4SLinus Torvalds4) By specifying the password in a file by file descriptor via PASSWD_FD 2491da177e4SLinus Torvalds 2501da177e4SLinus TorvaldsIf no password is provided, mount.cifs will prompt for password entry 2511da177e4SLinus Torvalds 2521da177e4SLinus TorvaldsRestrictions 2531da177e4SLinus Torvalds============ 254f139291cSMauro Carvalho Chehab 2551da177e4SLinus TorvaldsServers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC 256cea21805SJeff Layton1001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a 257cea21805SJeff Laytonproblem as most servers support this. 2581da177e4SLinus Torvalds 2591da177e4SLinus TorvaldsValid filenames differ between Windows and Linux. Windows typically restricts 2601da177e4SLinus Torvaldsfilenames which contain certain reserved characters (e.g.the character : 2611da177e4SLinus Torvaldswhich is used to delimit the beginning of a stream name by Windows), while 2621da177e4SLinus TorvaldsLinux allows a slightly wider set of valid characters in filenames. Windows 2631da177e4SLinus Torvaldsservers can remap such characters when an explicit mapping is specified in 2641da177e4SLinus Torvaldsthe Server's registry. Samba starting with version 3.10 will allow such 2651da177e4SLinus Torvaldsfilenames (ie those which contain valid Linux characters, which normally 2661da177e4SLinus Torvaldswould be forbidden for Windows/CIFS semantics) as long as the server is 2671da177e4SLinus Torvaldsconfigured for Unix Extensions (and the client has not disabled 268ec11653bSSteve French/proc/fs/cifs/LinuxExtensionsEnabled). In addition the mount option 269f139291cSMauro Carvalho Chehab``mapposix`` can be used on CIFS (vers=1.0) to force the mapping of 270b2105aa2SAndrew Klychkovillegal Windows/NTFS/SMB characters to a remap range (this mount parameter 271f139291cSMauro Carvalho Chehabis the default for SMB3). This remap (``mapposix``) range is also 272ec11653bSSteve Frenchcompatible with Mac (and "Services for Mac" on some older Windows). 2731da177e4SLinus TorvaldsWhen POSIX Extensions for SMB 3.1.1 are negotiated, remapping is automatically 2741da177e4SLinus Torvaldsdisabled. 2751da177e4SLinus Torvalds 2761da177e4SLinus TorvaldsCIFS VFS Mount Options 277f139291cSMauro Carvalho Chehab====================== 278f139291cSMauro Carvalho ChehabA partial list of the supported mount options follows: 279f139291cSMauro Carvalho Chehab 2801da177e4SLinus Torvalds username 281f139291cSMauro Carvalho Chehab The user name to use when trying to establish 282f139291cSMauro Carvalho Chehab the CIFS session. 2831da177e4SLinus Torvalds password 284f6d09982SSteve French The user password. If the mount helper is 285f139291cSMauro Carvalho Chehab installed, the user will be prompted for password 286f139291cSMauro Carvalho Chehab if not supplied. 287f139291cSMauro Carvalho Chehab ip 288f139291cSMauro Carvalho Chehab The ip address of the target server 2891da177e4SLinus Torvalds unc 290f139291cSMauro Carvalho Chehab The target server Universal Network Name (export) to 291f139291cSMauro Carvalho Chehab mount. 2921da177e4SLinus Torvalds domain 293f139291cSMauro Carvalho Chehab Set the SMB/CIFS workgroup name prepended to the 294f139291cSMauro Carvalho Chehab username during CIFS session establishment 295d098564fSSteve French forceuid 2964523cc30SSteve French Set the default uid for inodes to the uid 2974523cc30SSteve French passed in on mount. For mounts to servers 2984523cc30SSteve French which do support the CIFS Unix extensions, such as a 2994523cc30SSteve French properly configured Samba server, the server provides 3004523cc30SSteve French the uid, gid and mode so this parameter should not be 3014523cc30SSteve French specified unless the server and clients uid and gid 3024523cc30SSteve French numbering differ. If the server and client are in the 3034523cc30SSteve French same domain (e.g. running winbind or nss_ldap) and 30408559657SKees Cook the server supports the Unix Extensions then the uid 3054523cc30SSteve French and gid can be retrieved from the server (and uid 3064523cc30SSteve French and gid would not have to be specified on the mount. 3074523cc30SSteve French For servers which do not support the CIFS Unix 3081da177e4SLinus Torvalds extensions, the default uid (and gid) returned on lookup 309f139291cSMauro Carvalho Chehab of existing files will be the uid (gid) of the person 310d098564fSSteve French who executed the mount (root, except when mount.cifs 3111da177e4SLinus Torvalds is configured setuid for user mounts) unless the ``uid=`` 3121da177e4SLinus Torvalds (gid) mount option is specified. Also note that permission 3131da177e4SLinus Torvalds checks (authorization checks) on accesses to a file occur 3141da177e4SLinus Torvalds at the server, but there are cases in which an administrator 3151da177e4SLinus Torvalds may want to restrict at the client as well. For those 3161da177e4SLinus Torvalds servers which do not report a uid/gid owner 3171da177e4SLinus Torvalds (such as Windows), permissions can also be checked at the 318d098564fSSteve French client, and a crude form of client side permission checking 319f139291cSMauro Carvalho Chehab can be enabled by specifying file_mode and dir_mode on 320f139291cSMauro Carvalho Chehab the client. (default) 321f139291cSMauro Carvalho Chehab forcegid 322f139291cSMauro Carvalho Chehab (similar to above but for the groupid instead of uid) (default) 323d098564fSSteve French noforceuid 324d098564fSSteve French Fill in file owner information (uid) by requesting it from 325d098564fSSteve French the server if possible. With this option, the value given in 326f139291cSMauro Carvalho Chehab the uid= option (on mount) will only be used if the server 327f139291cSMauro Carvalho Chehab can not support returning uids on inodes. 328f139291cSMauro Carvalho Chehab noforcegid 329f139291cSMauro Carvalho Chehab (similar to above but for the group owner, gid, instead of uid) 330f0472d0eSSteve French uid 331f0472d0eSSteve French Set the default uid for inodes, and indicate to the 332f0472d0eSSteve French cifs kernel driver which local user mounted. If the server 333f139291cSMauro Carvalho Chehab supports the unix extensions the default uid is 334f139291cSMauro Carvalho Chehab not used to fill in the owner fields of inodes (files) 335f139291cSMauro Carvalho Chehab unless the ``forceuid`` parameter is specified. 336f139291cSMauro Carvalho Chehab gid 337f139291cSMauro Carvalho Chehab Set the default gid for inodes (similar to above). 3381da177e4SLinus Torvalds file_mode 339f139291cSMauro Carvalho Chehab If CIFS Unix extensions are not supported by the server 340f139291cSMauro Carvalho Chehab this overrides the default mode for file inodes. 3413694b91aSSuresh Jayaraman fsc 3423694b91aSSuresh Jayaraman Enable local disk caching using FS-Cache (off by default). This 3433694b91aSSuresh Jayaraman option could be useful to improve performance on a slow link, 3443694b91aSSuresh Jayaraman heavily loaded server and/or network where reading from the 3453694b91aSSuresh Jayaraman disk is faster than reading from the server (over the network). 3463694b91aSSuresh Jayaraman This could also impact scalability positively as the 3473694b91aSSuresh Jayaraman number of calls to the server are reduced. However, local 3483694b91aSSuresh Jayaraman caching is not suitable for all workloads for e.g. read-once 3493694b91aSSuresh Jayaraman type workloads. So, you need to consider carefully your 350f139291cSMauro Carvalho Chehab workload/scenario before using this option. Currently, local 351f139291cSMauro Carvalho Chehab disk caching is functional for CIFS files opened as read-only. 3521da177e4SLinus Torvalds dir_mode 353f139291cSMauro Carvalho Chehab If CIFS Unix extensions are not supported by the server 354f139291cSMauro Carvalho Chehab this overrides the default mode for directory inodes. 3551da177e4SLinus Torvalds port 356f139291cSMauro Carvalho Chehab attempt to contact the server on this tcp port, before 357f139291cSMauro Carvalho Chehab trying the usual ports (port 445, then 139). 3581da177e4SLinus Torvalds iocharset 3591da177e4SLinus Torvalds Codepage used to convert local path names to and from 3601da177e4SLinus Torvalds Unicode. Unicode is used by default for network path 3611da177e4SLinus Torvalds names if the server supports it. If iocharset is 3621da177e4SLinus Torvalds not specified then the nls_default specified 3631da177e4SLinus Torvalds during the local client kernel build will be used. 364f139291cSMauro Carvalho Chehab If server does not support Unicode, this parameter is 365f139291cSMauro Carvalho Chehab unused. 36675865f8cSSteve French rsize 36775865f8cSSteve French default read size (usually 16K). The client currently 36875865f8cSSteve French can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize 36975865f8cSSteve French defaults to 16K and may be changed (from 8K to the maximum 37075865f8cSSteve French kmalloc size allowed by your kernel) at module install time 37175865f8cSSteve French for cifs.ko. Setting CIFSMaxBufSize to a very large value 37275865f8cSSteve French will cause cifs to use more memory and may reduce performance 37375865f8cSSteve French in some cases. To use rsize greater than 127K (the original 37475865f8cSSteve French cifs protocol maximum) also requires that the server support 37575865f8cSSteve French a new Unix Capability flag (for very large read) which some 37675865f8cSSteve French newer servers (e.g. Samba 3.0.26 or later) do. rsize can be 377f139291cSMauro Carvalho Chehab set from a minimum of 2048 to a maximum of 130048 (127K or 378f139291cSMauro Carvalho Chehab CIFSMaxBufSize, whichever is smaller) 37975865f8cSSteve French wsize 38075865f8cSSteve French default write size (default 57344) 381f139291cSMauro Carvalho Chehab maximum wsize currently allowed by CIFS is 57344 (fourteen 382f139291cSMauro Carvalho Chehab 4096 byte pages) 3836d20e840SSuresh Jayaraman actimeo=n 3846d20e840SSuresh Jayaraman attribute cache timeout in seconds (default 1 second). 3856d20e840SSuresh Jayaraman After this timeout, the cifs client requests fresh attribute 3866d20e840SSuresh Jayaraman information from the server. This option allows to tune the 3876d20e840SSuresh Jayaraman attribute cache timeout to suit the workload needs. Shorter 3886d20e840SSuresh Jayaraman timeouts mean better the cache coherency, but increased number 3896d20e840SSuresh Jayaraman of calls to the server. Longer timeouts mean reduced number 3906d20e840SSuresh Jayaraman of calls to the server at the expense of less stricter cache 391f139291cSMauro Carvalho Chehab coherency checks (i.e. incorrect attribute cache for a short 392f139291cSMauro Carvalho Chehab period of time). 3931da177e4SLinus Torvalds rw 394f139291cSMauro Carvalho Chehab mount the network share read-write (note that the 395f139291cSMauro Carvalho Chehab server may still consider the share read-only) 396f139291cSMauro Carvalho Chehab ro 397f139291cSMauro Carvalho Chehab mount network share read-only 3981da177e4SLinus Torvalds version 399f139291cSMauro Carvalho Chehab used to distinguish different versions of the 400f139291cSMauro Carvalho Chehab mount helper utility (not typically needed) 4011da177e4SLinus Torvalds sep 402dbeb56feSRandy Dunlap if first mount option (after the -o), overrides 403f139291cSMauro Carvalho Chehab the comma as the separator between the mount 4041da177e4SLinus Torvalds parameters. e.g.:: 405f139291cSMauro Carvalho Chehab 406f139291cSMauro Carvalho Chehab -o user=myname,password=mypassword,domain=mydom 407f139291cSMauro Carvalho Chehab 4081da177e4SLinus Torvalds could be passed instead with period as the separator by:: 409f139291cSMauro Carvalho Chehab 4101da177e4SLinus Torvalds -o sep=.user=myname.password=mypassword.domain=mydom 4111da177e4SLinus Torvalds 4121da177e4SLinus Torvalds this might be useful when comma is contained within username 4131da177e4SLinus Torvalds or password or domain. This option is less important 414f139291cSMauro Carvalho Chehab when the cifs mount helper cifs.mount (version 1.1 or later) 415f139291cSMauro Carvalho Chehab is used. 4161da177e4SLinus Torvalds nosuid 4171da177e4SLinus Torvalds Do not allow remote executables with the suid bit 4181da177e4SLinus Torvalds program to be executed. This is only meaningful for mounts 4191da177e4SLinus Torvalds to servers such as Samba which support the CIFS Unix Extensions. 4201da177e4SLinus Torvalds If you do not trust the servers in your network (your mount 421f139291cSMauro Carvalho Chehab targets) it is recommended that you specify this option for 422f139291cSMauro Carvalho Chehab greater security. 423f139291cSMauro Carvalho Chehab exec 424f139291cSMauro Carvalho Chehab Permit execution of binaries on the mount. 425f139291cSMauro Carvalho Chehab noexec 426f139291cSMauro Carvalho Chehab Do not permit execution of binaries on the mount. 427f139291cSMauro Carvalho Chehab dev 428f139291cSMauro Carvalho Chehab Recognize block devices on the remote mount. 429f139291cSMauro Carvalho Chehab nodev 430f139291cSMauro Carvalho Chehab Do not recognize devices on the remote mount. 4311da177e4SLinus Torvalds suid 4321da177e4SLinus Torvalds Allow remote files on this mountpoint with suid enabled to 433f139291cSMauro Carvalho Chehab be executed (default for mounts when executed as root, 434f139291cSMauro Carvalho Chehab nosuid is default for user mounts). 4351da177e4SLinus Torvalds credentials 4361da177e4SLinus Torvalds Although ignored by the cifs kernel component, it is used by 4371da177e4SLinus Torvalds the mount helper, mount.cifs. When mount.cifs is installed it 4381da177e4SLinus Torvalds opens and reads the credential file specified in order 439f139291cSMauro Carvalho Chehab to obtain the userid and password arguments which are passed to 440f139291cSMauro Carvalho Chehab the cifs vfs. 4411da177e4SLinus Torvalds guest 4421da177e4SLinus Torvalds Although ignored by the kernel component, the mount.cifs 4431da177e4SLinus Torvalds mount helper will not prompt the user for a password 444f139291cSMauro Carvalho Chehab if guest is specified on the mount options. If no 445f139291cSMauro Carvalho Chehab password is specified a null password will be used. 4461da177e4SLinus Torvalds perm 4471da177e4SLinus Torvalds Client does permission checks (vfs_permission check of uid 4481da177e4SLinus Torvalds and gid of the file against the mode and desired operation), 4491da177e4SLinus Torvalds Note that this is in addition to the normal ACL check on the 450f139291cSMauro Carvalho Chehab target machine done by the server software. 451f139291cSMauro Carvalho Chehab Client permission checking is enabled by default. 4521da177e4SLinus Torvalds noperm 4531da177e4SLinus Torvalds Client does not do permission checks. This can expose 4541da177e4SLinus Torvalds files on this mount to access by other users on the local 4551da177e4SLinus Torvalds client system. It is typically only needed when the server 4566473a559SSteve French supports the CIFS Unix Extensions but the UIDs/GIDs on the 4576473a559SSteve French client and server system do not match closely enough to allow 4586473a559SSteve French access by the user doing the mount, but it may be useful with 4596473a559SSteve French non CIFS Unix Extension mounts for cases in which the default 4601da177e4SLinus Torvalds mode is specified on the mount but is not to be enforced on the 4611da177e4SLinus Torvalds client (e.g. perhaps when MultiUserMount is enabled) 4621da177e4SLinus Torvalds Note that this does not affect the normal ACL check on the 463f139291cSMauro Carvalho Chehab target machine done by the server software (of the server 464f139291cSMauro Carvalho Chehab ACL against the user name provided at mount time). 4651da177e4SLinus Torvalds serverino 4661da177e4SLinus Torvalds Use server's inode numbers instead of generating automatically 4671da177e4SLinus Torvalds incrementing inode numbers on the client. Although this will 4681da177e4SLinus Torvalds make it easier to spot hardlinked files (as they will have 4691da177e4SLinus Torvalds the same inode numbers) and inode numbers may be persistent, 4701da177e4SLinus Torvalds note that the server does not guarantee that the inode numbers 4711da177e4SLinus Torvalds are unique if multiple server side mounts are exported under a 4727521a3c5SSteve French single share (since inode numbers on the servers might not 4737521a3c5SSteve French be unique if multiple filesystems are mounted under the same 4747521a3c5SSteve French shared higher level directory). Note that some older 4757521a3c5SSteve French (e.g. pre-Windows 2000) do not support returning UniqueIDs 4767521a3c5SSteve French or the CIFS Unix Extensions equivalent and for those 477c5077ec4SSteve French this mount option will have no effect. Exporting cifs mounts 478c5077ec4SSteve French under nfsd requires this mount option on the cifs mount. 479f139291cSMauro Carvalho Chehab This is now the default if server supports the 480f139291cSMauro Carvalho Chehab required network operation. 481c5077ec4SSteve French noserverino 482c5077ec4SSteve French Client generates inode numbers (rather than using the actual one 483c5077ec4SSteve French from the server). These inode numbers will vary after 484c5077ec4SSteve French unmount or reboot which can confuse some applications, 485f139291cSMauro Carvalho Chehab but not all server filesystems support unique inode 486f139291cSMauro Carvalho Chehab numbers. 4871da177e4SLinus Torvalds setuids 4881da177e4SLinus Torvalds If the CIFS Unix extensions are negotiated with the server 4896473a559SSteve French the client will attempt to set the effective uid and gid of 4906473a559SSteve French the local process on newly created files, directories, and 491cab00891SMatt LaPlante devices (create, mkdir, mknod). If the CIFS Unix Extensions 4926473a559SSteve French are not negotiated, for newly created files and directories 4936473a559SSteve French instead of using the default uid and gid specified on 4946473a559SSteve French the mount, cache the new file's uid and gid locally which means 495f139291cSMauro Carvalho Chehab that the uid for the file can change when the inode is 496f139291cSMauro Carvalho Chehab reloaded (or the user remounts the share). 4971da177e4SLinus Torvalds nosetuids 4981da177e4SLinus Torvalds The client will not attempt to set the uid and gid on 4991da177e4SLinus Torvalds on newly created files, directories, and devices (create, 50067594febSSteve French mkdir, mknod) which will result in the server setting the 5016473a559SSteve French uid and gid to the default (usually the server uid of the 5026473a559SSteve French user who mounted the share). Letting the server (rather than 5036473a559SSteve French the client) set the uid and gid is the default. If the CIFS 5046473a559SSteve French Unix Extensions are not negotiated then the uid and gid for 505f139291cSMauro Carvalho Chehab new files will appear to be the uid (gid) of the mounter or the 506f139291cSMauro Carvalho Chehab uid (gid) parameter specified on the mount. 5071da177e4SLinus Torvalds netbiosname 5081da177e4SLinus Torvalds When mounting to servers via port 139, specifies the RFC1001 509f139291cSMauro Carvalho Chehab source name to use to represent the client netbios machine 510f139291cSMauro Carvalho Chehab name when doing the RFC1001 netbios session initialize. 511af901ca1SAndré Goddard Rosa direct 5121da177e4SLinus Torvalds Do not do inode data caching on files opened on this mount. 5131da177e4SLinus Torvalds This precludes mmapping files on this mount. In some cases 5141da177e4SLinus Torvalds with fast networks and little or no caching benefits on the 5151da177e4SLinus Torvalds client (e.g. when the application is doing large sequential 51667594febSSteve French reads bigger than page size without rereading the same data) 5171da177e4SLinus Torvalds this can provide better performance than the default 5181da177e4SLinus Torvalds behavior which caches reads (readahead) and writes 5191da177e4SLinus Torvalds (writebehind) through the local Linux client pagecache 5201da177e4SLinus Torvalds if oplock (caching token) is granted and held. Note that 521f139291cSMauro Carvalho Chehab direct allows write operations larger than page size 522f139291cSMauro Carvalho Chehab to be sent to the server. 523d39454ffSPavel Shilovsky strictcache 524d39454ffSPavel Shilovsky Use for switching on strict cache mode. In this mode the 525d39454ffSPavel Shilovsky client read from the cache all the time it has Oplock Level II, 526d39454ffSPavel Shilovsky otherwise - read from the server. All written data are stored 527f139291cSMauro Carvalho Chehab in the cache, but if the client doesn't have Exclusive Oplock, 528f139291cSMauro Carvalho Chehab it writes the data to the server. 529d4ffff1fSPavel Shilovsky rwpidforward 530d4ffff1fSPavel Shilovsky Forward pid of a process who opened a file to any read or write 531f139291cSMauro Carvalho Chehab operation on that file. This prevent applications like WINE 532f139291cSMauro Carvalho Chehab from failing on read and write if we use mandatory brlock style. 5331da177e4SLinus Torvalds acl 534f139291cSMauro Carvalho Chehab Allow setfacl and getfacl to manage posix ACLs if server 535f139291cSMauro Carvalho Chehab supports them. (default) 536f139291cSMauro Carvalho Chehab noacl 537f139291cSMauro Carvalho Chehab Do not allow setfacl and getfacl calls on this mount 538f139291cSMauro Carvalho Chehab user_xattr 539f6d09982SSteve French Allow getting and setting user xattrs (those attributes whose 540f6d09982SSteve French name begins with ``user.`` or ``os2.``) as OS/2 EAs (extended 541f139291cSMauro Carvalho Chehab attributes) to the server. This allows support of the 542f139291cSMauro Carvalho Chehab setfattr and getfattr utilities. (default) 543f139291cSMauro Carvalho Chehab nouser_xattr 544f139291cSMauro Carvalho Chehab Do not allow getfattr/setfattr to get/set/list xattrs 545f139291cSMauro Carvalho Chehab mapchars 546737b758cSSteve French Translate six of the seven reserved characters (not backslash):: 547f139291cSMauro Carvalho Chehab 5486a0b4824SSteve French *?<>|: 5496a0b4824SSteve French 5506a0b4824SSteve French to the remap range (above 0xF000), which also 5516a0b4824SSteve French allows the CIFS client to recognize files created with 5526a0b4824SSteve French such characters by Windows's POSIX emulation. This can 5536a0b4824SSteve French also be useful when mounting to most versions of Samba 5546a0b4824SSteve French (which also forbids creating and opening files 5556a0b4824SSteve French whose names contain any of these seven characters). 556f139291cSMauro Carvalho Chehab This has no effect if the server does not support 557f139291cSMauro Carvalho Chehab Unicode on the wire. 558f139291cSMauro Carvalho Chehab nomapchars 559f139291cSMauro Carvalho Chehab Do not translate any of these seven characters (default). 56002582e9bSMasanari Iida nocase 561f139291cSMauro Carvalho Chehab Request case insensitive path name matching (case 562f139291cSMauro Carvalho Chehab sensitive is the default if the server supports it). 563f139291cSMauro Carvalho Chehab (mount option ``ignorecase`` is identical to ``nocase``) 56482940a46SSteve French posixpaths 56582940a46SSteve French If CIFS Unix extensions are supported, attempt to 56682940a46SSteve French negotiate posix path name support which allows certain 567f139291cSMauro Carvalho Chehab characters forbidden in typical CIFS filenames, without 568f139291cSMauro Carvalho Chehab requiring remapping. (default) 56982940a46SSteve French noposixpaths 57082940a46SSteve French If CIFS Unix extensions are supported, do not request 571f139291cSMauro Carvalho Chehab posix path name support (this may cause servers to 572f139291cSMauro Carvalho Chehab reject creatingfile with certain reserved characters). 573a403a0a3SSteve French nounix 574a403a0a3SSteve French Disable the CIFS Unix Extensions for this mount (tree 575a403a0a3SSteve French connection). This is rarely needed, but it may be useful 576a403a0a3SSteve French in order to turn off multiple settings all at once (ie 577a403a0a3SSteve French posix acls, posix locks, posix paths, symlink support 578a403a0a3SSteve French and retrieving uids/gids/mode from the server) or to 579f139291cSMauro Carvalho Chehab work around a bug in server which implement the Unix 580f139291cSMauro Carvalho Chehab Extensions. 581c46fa8acSSteve French nobrl 582c46fa8acSSteve French Do not send byte range lock requests to the server. 583c46fa8acSSteve French This is necessary for certain applications that break 584c46fa8acSSteve French with cifs style mandatory byte range locks (and most 585f139291cSMauro Carvalho Chehab cifs servers do not yet support requesting advisory 586f139291cSMauro Carvalho Chehab byte range locks). 58713a6e42aSSteve French forcemandatorylock 58813a6e42aSSteve French Even if the server supports posix (advisory) byte range 58913a6e42aSSteve French locking, send only mandatory lock requests. For some 59013a6e42aSSteve French (presumably rare) applications, originally coded for 59113a6e42aSSteve French DOS/Windows, which require Windows style mandatory byte range 59213a6e42aSSteve French locking, they may be able to take advantage of this option, 593f139291cSMauro Carvalho Chehab forcing the cifs client to only send mandatory locks 59413a6e42aSSteve French even if the cifs server would support posix advisory locks. 595f139291cSMauro Carvalho Chehab ``forcemand`` is accepted as a shorter form of this mount 596f139291cSMauro Carvalho Chehab option. 597be652445SSteve French nostrictsync 598be652445SSteve French If this mount option is set, when an application does an 599be652445SSteve French fsync call then the cifs client does not send an SMB Flush 600be652445SSteve French to the server (to force the server to write all dirty data 601be652445SSteve French for this file immediately to disk), although cifs still sends 602be652445SSteve French all dirty (cached) file data to the server and waits for the 603be652445SSteve French server to respond to the write. Since SMB Flush can be 604be652445SSteve French very slow, and some servers may be reliable enough (to risk 605be652445SSteve French delaying slightly flushing the data to disk on the server), 606be652445SSteve French turning on this option may be useful to improve performance for 607be652445SSteve French applications that fsync too much, at a small risk of server 608be652445SSteve French crash. If this mount option is not set, by default cifs will 609f139291cSMauro Carvalho Chehab send an SMB flush request (and wait for a response) on every 610f139291cSMauro Carvalho Chehab fsync call. 6112c1b8615SSteve French nodfs 61213a6e42aSSteve French Disable DFS (global name space support) even if the 61313a6e42aSSteve French server claims to support it. This can help work around 614f139291cSMauro Carvalho Chehab a problem with parsing of DFS paths with Samba server 615f139291cSMauro Carvalho Chehab versions 3.0.24 and 3.0.25. 6160cb766aeSSteve French remount 617f139291cSMauro Carvalho Chehab remount the share (often used to change from ro to rw mounts 618f139291cSMauro Carvalho Chehab or vice versa) 619cea21805SJeff Layton cifsacl 620f139291cSMauro Carvalho Chehab Report mode bits (e.g. on stat) based on the Windows ACL for 621f139291cSMauro Carvalho Chehab the file. (EXPERIMENTAL) 622ad7a2926SSteve French servern 6235e6e6232SCyrill Gorcunov Specify the server 's netbios name (RFC1001 name) to use 6245e6e6232SCyrill Gorcunov when attempting to setup a session to the server. 6255e6e6232SCyrill Gorcunov This is needed for mounting to some older servers (such 6265e6e6232SCyrill Gorcunov as OS/2 or Windows 98 and Windows ME) since they do not 627f139291cSMauro Carvalho Chehab support a default server name. A server name can be up 628f139291cSMauro Carvalho Chehab to 15 characters long and is usually uppercased. 6296473a559SSteve French sfu 6306473a559SSteve French When the CIFS Unix Extensions are not negotiated, attempt to 6316473a559SSteve French create device files and fifos in a format compatible with 632cab00891SMatt LaPlante Services for Unix (SFU). In addition retrieve bits 10-12 6336473a559SSteve French of the mode via the SETFILEBITS extended attribute (as 6346473a559SSteve French SFU does). In the future the bottom 9 bits of the 635f139291cSMauro Carvalho Chehab mode also will be emulated using queries of the security 636f139291cSMauro Carvalho Chehab descriptor (ACL). 637736a3320SStefan Metzmacher mfsymlinks 638736a3320SStefan Metzmacher Enable support for Minshall+French symlinks 639736a3320SStefan Metzmacher (see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks) 640736a3320SStefan Metzmacher This option is ignored when specified together with the 641f139291cSMauro Carvalho Chehab 'sfu' option. Minshall+French symlinks are used even if 642f139291cSMauro Carvalho Chehab the server supports the CIFS Unix Extensions. 643750d1151SSteve French sign 644750d1151SSteve French Must use packet signing (helps avoid unwanted data modification 645f139291cSMauro Carvalho Chehab by intermediate systems in the route). Note that signing 646f139291cSMauro Carvalho Chehab does not work with lanman or plaintext authentication. 64795b1cb90SSteve French seal 64895b1cb90SSteve French Must seal (encrypt) all data on this mounted share before 64995b1cb90SSteve French sending on the network. Requires support for Unix Extensions. 65095b1cb90SSteve French Note that this differs from the sign mount option in that it 651f139291cSMauro Carvalho Chehab causes encryption of data sent over this mounted share but other 652f139291cSMauro Carvalho Chehab shares mounted to the same server are unaffected. 65384210e91SSteve French locallease 65484210e91SSteve French This option is rarely needed. Fcntl F_SETLEASE is 65584210e91SSteve French used by some applications such as Samba and NFSv4 server to 65684210e91SSteve French check to see whether a file is cacheable. CIFS has no way 65784210e91SSteve French to explicitly request a lease, but can check whether a file 65884210e91SSteve French is cacheable (oplocked). Unfortunately, even if a file 65984210e91SSteve French is not oplocked, it could still be cacheable (ie cifs client 66084210e91SSteve French could grant fcntl leases if no other local processes are using 66184210e91SSteve French the file) for cases for example such as when the server does not 66284210e91SSteve French support oplocks and the user is sure that the only updates to 66384210e91SSteve French the file will be from this client. Specifying this mount option 66484210e91SSteve French will allow the cifs client to check for leases (only) locally 665f139291cSMauro Carvalho Chehab for files which are not oplocked instead of denying leases 666f139291cSMauro Carvalho Chehab in that case. (EXPERIMENTAL) 667f139291cSMauro Carvalho Chehab sec 668f139291cSMauro Carvalho Chehab Security mode. Allowed values are: 669f139291cSMauro Carvalho Chehab 670f139291cSMauro Carvalho Chehab none 671f139291cSMauro Carvalho Chehab attempt to connection as a null user (no name) 672f139291cSMauro Carvalho Chehab krb5 673f139291cSMauro Carvalho Chehab Use Kerberos version 5 authentication 674f139291cSMauro Carvalho Chehab krb5i 675f139291cSMauro Carvalho Chehab Use Kerberos authentication and packet signing 676f139291cSMauro Carvalho Chehab ntlm 677f139291cSMauro Carvalho Chehab Use NTLM password hashing (default) 678bf820679SSteve French ntlmi 679bf820679SSteve French Use NTLM password hashing with signing (if 680f139291cSMauro Carvalho Chehab /proc/fs/cifs/PacketSigningEnabled on or if 681f139291cSMauro Carvalho Chehab server requires signing also can be the default) 682f139291cSMauro Carvalho Chehab ntlmv2 683f139291cSMauro Carvalho Chehab Use NTLMv2 password hashing 684f139291cSMauro Carvalho Chehab ntlmv2i 685f139291cSMauro Carvalho Chehab Use NTLMv2 password hashing with packet signing 686189acaaeSSteve French lanman 687f139291cSMauro Carvalho Chehab (if configured in kernel config) use older 688f139291cSMauro Carvalho Chehab lanman hash 689f139291cSMauro Carvalho Chehab hard 690f139291cSMauro Carvalho Chehab Retry file operations if server is not responding 691f6d09982SSteve French soft 6921da177e4SLinus Torvalds Limit retries to unresponsive servers (usually only 6931da177e4SLinus Torvalds one retry) before returning an error. (default) 6941da177e4SLinus Torvalds 6951da177e4SLinus TorvaldsThe mount.cifs mount helper also accepts a few mount options before -o 696f139291cSMauro Carvalho Chehabincluding: 6971da177e4SLinus Torvalds 698f139291cSMauro Carvalho Chehab=============== =============================================================== 6991da177e4SLinus Torvalds -S take password from stdin (equivalent to setting the environment 7001da177e4SLinus Torvalds variable ``PASSWD_FD=0`` 701f139291cSMauro Carvalho Chehab -V print mount.cifs version 7021da177e4SLinus Torvalds -? display simple usage information 7038426c39cSJeff Layton=============== =============================================================== 7041da177e4SLinus Torvalds 7051da177e4SLinus TorvaldsWith most 2.6 kernel versions of modutils, the version of the cifs kernel 7061da177e4SLinus Torvaldsmodule can be displayed via modinfo. 7071da177e4SLinus Torvalds 708f139291cSMauro Carvalho ChehabMisc /proc/fs/cifs Flags and Debug Info 7091da177e4SLinus Torvalds======================================= 710f139291cSMauro Carvalho Chehab 711f139291cSMauro Carvalho ChehabInformational pseudo-files: 71295c99904SSuresh Jayaraman 71395c99904SSuresh Jayaraman======================= ======================================================= 71495c99904SSuresh JayaramanDebugData Displays information about active CIFS sessions and 7151da177e4SLinus Torvalds shares, features enabled as well as the cifs.ko 7163de5e974SSteve French version. 717443dd65dSAurelien AptelStats Lists summary resource usage information as well as per 718*d7851dc1SSteve French share statistics. 719f139291cSMauro Carvalho Chehabopen_files List all the open file handles on all active SMB sessions. 7201da177e4SLinus Torvaldsmount_params List of all mount parameters available for the module 7211da177e4SLinus Torvalds======================= ======================================================= 722f139291cSMauro Carvalho Chehab 723f139291cSMauro Carvalho ChehabConfiguration pseudo-files: 724254e55edSSteve French 725254e55edSSteve French======================= ======================================================= 726254e55edSSteve FrenchSecurityFlags Flags which control security negotiation and 727254e55edSSteve French also packet signing. Authentication (may/must) 728254e55edSSteve French flags (e.g. for NTLMv2) may be combined with 729f139291cSMauro Carvalho Chehab the signing flags. Specifying two different password 730f139291cSMauro Carvalho Chehab hashing mechanisms (as "must use") on the other hand 731254e55edSSteve French does not make much sense. Default flags are:: 732f139291cSMauro Carvalho Chehab 7332e655021SSteve French 0x00C5 734254e55edSSteve French 735254e55edSSteve French (NTLMv2 and packet signing allowed). Some SecurityFlags 7362e655021SSteve French may require enabling a corresponding menuconfig option. 7372e655021SSteve French 7382ac7069aSAlexandre Ghiti may use packet signing 0x00001 7392ac7069aSAlexandre Ghiti must use packet signing 0x01001 7402ac7069aSAlexandre Ghiti may use NTLMv2 0x00004 7412e655021SSteve French must use NTLMv2 0x04004 7422e655021SSteve French may use Kerberos security (krb5) 0x00008 7432e655021SSteve French must use Kerberos 0x08008 7442e655021SSteve French may use NTLMSSP 0x00080 745f139291cSMauro Carvalho Chehab must use NTLMSSP 0x80080 746254e55edSSteve French seal (packet encryption) 0x00040 747254e55edSSteve French must seal 0x40040 748254e55edSSteve French 749254e55edSSteve FrenchcifsFYI If set to non-zero value, additional debug information 750254e55edSSteve French will be logged to the system error log. This field 751254e55edSSteve French contains three flags controlling different classes of 752254e55edSSteve French debugging entries. The maximum value it can be set 753f6d09982SSteve French to is 7 which enables all debugging points (default 0). 754f6d09982SSteve French Some debugging statements are not compiled into the 755254e55edSSteve French cifs kernel unless CONFIG_CIFS_DEBUG2 is enabled in the 756254e55edSSteve French kernel configuration. cifsFYI may be set to one or 757254e55edSSteve French more of the following flags (7 sets them all):: 758254e55edSSteve French 759254e55edSSteve French +-----------------------------------------------+------+ 760254e55edSSteve French | log cifs informational messages | 0x01 | 7618426c39cSJeff Layton +-----------------------------------------------+------+ 7628426c39cSJeff Layton | log return codes from cifs entry points | 0x02 | 7638426c39cSJeff Layton +-----------------------------------------------+------+ 7648426c39cSJeff Layton | log slow responses | 0x04 | 7658426c39cSJeff Layton | (ie which take longer than 1 second) | | 7668426c39cSJeff Layton | | | 7678426c39cSJeff Layton | CONFIG_CIFS_STATS2 must be enabled in .config | | 7688426c39cSJeff Layton +-----------------------------------------------+------+ 769dbeb56feSRandy Dunlap 7708426c39cSJeff LaytontraceSMB If set to one, debug information is logged to the 771f139291cSMauro Carvalho Chehab system error log with the start of smb requests 772f139291cSMauro Carvalho Chehab and responses (default 0) 773f139291cSMauro Carvalho ChehabLookupCacheEnable If set to one, inode information is kept cached 774f139291cSMauro Carvalho Chehab for one second improving performance of lookups 775f139291cSMauro Carvalho Chehab (default 1) 776f139291cSMauro Carvalho ChehabLinuxExtensionsEnabled If set to one then the client will attempt to 777f139291cSMauro Carvalho Chehab use the CIFS "UNIX" extensions which are optional 778f139291cSMauro Carvalho Chehab protocol enhancements that allow CIFS servers 779f139291cSMauro Carvalho Chehab to return accurate UID/GID information as well 780f139291cSMauro Carvalho Chehab as support symbolic links. If you use servers 7818426c39cSJeff Layton such as Samba that support the CIFS Unix 7821da177e4SLinus Torvalds extensions but do not want to use symbolic link 7831da177e4SLinus Torvalds support and want to map the uid and gid fields 7841da177e4SLinus Torvalds to values supplied at mount (rather than the 7851da177e4SLinus Torvalds actual values, then set this to zero. (default 1) 7861da177e4SLinus Torvaldsdfscache List the content of the DFS cache. 7871da177e4SLinus Torvalds If set to 0, the client will clear the cache. 7881da177e4SLinus Torvalds======================= ======================================================= 7891da177e4SLinus Torvalds 7901da177e4SLinus TorvaldsThese experimental features and tracing can be enabled by changing flags in 7911da177e4SLinus Torvalds/proc/fs/cifs (after the cifs module has been installed or built into the 7921da177e4SLinus Torvaldskernel, e.g. insmod cifs). To enable a feature set it to 1 e.g. to enable 7931da177e4SLinus Torvaldstracing to the kernel message log type:: 7941da177e4SLinus Torvalds 7951da177e4SLinus Torvalds echo 7 > /proc/fs/cifs/cifsFYI 7961da177e4SLinus Torvalds 7971da177e4SLinus TorvaldscifsFYI functions as a bit mask. Setting it to 1 enables additional kernel 798443dd65dSAurelien Aptellogging of various informational messages. 2 enables logging of non-zero 799443dd65dSAurelien AptelSMB return codes while 4 enables logging of requests that take longer 800f139291cSMauro Carvalho Chehabthan one second to complete (except for byte range lock requests). 8011da177e4SLinus TorvaldsSetting it to 4 requires CONFIG_CIFS_STATS2 to be set in kernel configuration 8021da177e4SLinus Torvalds(.config). Setting it to seven enables all three. Finally, tracing 8031da177e4SLinus Torvaldsthe start of smb requests and responses can be enabled via:: 8041da177e4SLinus Torvalds 805f139291cSMauro Carvalho Chehab echo 1 > /proc/fs/cifs/traceSMB 8061da177e4SLinus Torvalds 8071047abc1SSteve FrenchPer share (per client mount) statistics are available in /proc/fs/cifs/Stats. 8081da177e4SLinus TorvaldsAdditional information is available if CONFIG_CIFS_STATS2 is enabled in the 8091047abc1SSteve Frenchkernel configuration (.config). The statistics returned include counters which 8101047abc1SSteve Frenchrepresent the number of attempted and failed (ie non-zero return code from the 8111047abc1SSteve Frenchserver) SMB3 (or cifs) requests grouped by request type (read, write, close etc.). 8121047abc1SSteve FrenchAlso recorded is the total bytes read and bytes written to the server for 8133de5e974SSteve Frenchthat share. Note that due to client caching effects this can be less than the 8143de5e974SSteve Frenchnumber of bytes read and written by the application running on the client. 815f139291cSMauro Carvalho ChehabStatistics can be reset to zero by ``echo 0 > /proc/fs/cifs/Stats`` which may be 8161da177e4SLinus Torvaldsuseful if comparing performance of two different scenarios. 8171da177e4SLinus Torvalds 8181da177e4SLinus TorvaldsAlso note that ``cat /proc/fs/cifs/DebugData`` will display information about 8193de5e974SSteve Frenchthe active sessions and the shares that are mounted. 8203de5e974SSteve French 8213de5e974SSteve FrenchEnabling Kerberos (extended security) works but requires version 1.2 or later 8223de5e974SSteve Frenchof the helper program cifs.upcall to be present and to be configured in the 8233de5e974SSteve French/etc/request-key.conf file. The cifs.upcall helper program is from the Samba 8241da177e4SLinus Torvaldsproject(https://www.samba.org). NTLM and NTLMv2 and LANMAN support do not 8251da177e4SLinus Torvaldsrequire this helper. Note that NTLMv2 security (which does not require the 8261da177e4SLinus Torvaldscifs.upcall helper program), instead of using Kerberos, is sufficient for 827f139291cSMauro Carvalho Chehabsome use cases. 8283de5e974SSteve French 8291da177e4SLinus TorvaldsDFS support allows transparent redirection to shares in an MS-DFS name space. 830f139291cSMauro Carvalho ChehabIn addition, DFS support for target shares which are specified as UNC 831cea21805SJeff Laytonnames which begin with host names (rather than IP addresses) requires 8323d2af346SSteve Frencha user space helper (such as cifs.upcall) to be present in order to 8333d2af346SSteve Frenchtranslate host names to ip address, and the user space helper must also 8343d2af346SSteve Frenchbe configured in the file /etc/request-key.conf. Samba, Windows servers and 8353d2af346SSteve Frenchmany NAS appliances support DFS as a way of constructing a global name 836cba22b1cSAlexander A. Klimovspace to ease network configuration and improve reliability. 8373d2af346SSteve French 8383d2af346SSteve FrenchTo use cifs Kerberos and DFS support, the Linux keyutils package should be 8393d2af346SSteve Frenchinstalled and something like the following lines should be added to the 8403d2af346SSteve French/etc/request-key.conf file:: 841be652445SSteve French 842be652445SSteve French create cifs.spnego * * /usr/local/sbin/cifs.upcall %k 8433d2af346SSteve French create dns_resolver * * /usr/local/sbin/cifs.upcall %k 8443d2af346SSteve French 8453d2af346SSteve FrenchCIFS kernel module parameters 846be652445SSteve French============================= 847be652445SSteve FrenchThese module parameters can be specified or modified either during the time of 848be652445SSteve Frenchmodule loading or during the runtime by using the interface:: 8493d2af346SSteve French 8503d2af346SSteve French /sys/module/cifs/parameters/<param> 8513d2af346SSteve French 852f139291cSMauro Carvalho Chehabi.e.:: 8533d2af346SSteve French 8543d2af346SSteve French echo "value" > /sys/module/cifs/parameters/<param> 8553d2af346SSteve French 8563d2af346SSteve FrenchMore detailed descriptions of the available module parameters and their values 857c9c4708fSSuresh Jayaramancan be seen by doing: 858c9c4708fSSuresh Jayaraman 859c9c4708fSSuresh Jayaraman modinfo cifs (or modinfo smb3) 860f139291cSMauro Carvalho Chehab 861f139291cSMauro Carvalho Chehab================= ========================================================== 8620bf58827SVolker Lendecke1. enable_oplocks Enable or disable oplocks. Oplocks are enabled by default. 863c9c4708fSSuresh Jayaraman [Y/y/1]. To disable use any of [N/n/0]. 864f139291cSMauro Carvalho Chehab================= ========================================================== 865c9c4708fSSuresh Jayaraman