1*4882a593Smuzhiyun===== 2*4882a593SmuzhiyunUsage 3*4882a593Smuzhiyun===== 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunThis module supports the SMB3 family of advanced network protocols (as well 6*4882a593Smuzhiyunas older dialects, originally called "CIFS" or SMB1). 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunThe CIFS VFS module for Linux supports many advanced network filesystem 9*4882a593Smuzhiyunfeatures such as hierarchical DFS like namespace, hardlinks, locking and more. 10*4882a593SmuzhiyunIt was designed to comply with the SNIA CIFS Technical Reference (which 11*4882a593Smuzhiyunsupersedes the 1992 X/Open SMB Standard) as well as to perform best practice 12*4882a593Smuzhiyunpractical interoperability with Windows 2000, Windows XP, Samba and equivalent 13*4882a593Smuzhiyunservers. This code was developed in participation with the Protocol Freedom 14*4882a593SmuzhiyunInformation Foundation. CIFS and now SMB3 has now become a defacto 15*4882a593Smuzhiyunstandard for interoperating between Macs and Windows and major NAS appliances. 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunPlease see 18*4882a593SmuzhiyunMS-SMB2 (for detailed SMB2/SMB3/SMB3.1.1 protocol specification) 19*4882a593Smuzhiyunor https://samba.org/samba/PFIF/ 20*4882a593Smuzhiyunfor more details. 21*4882a593Smuzhiyun 22*4882a593Smuzhiyun 23*4882a593SmuzhiyunFor questions or bug reports please contact: 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun smfrench@gmail.com 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunSee the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils 28*4882a593Smuzhiyun 29*4882a593SmuzhiyunBuild instructions 30*4882a593Smuzhiyun================== 31*4882a593Smuzhiyun 32*4882a593SmuzhiyunFor Linux: 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun1) Download the kernel (e.g. from https://www.kernel.org) 35*4882a593Smuzhiyun and change directory into the top of the kernel directory tree 36*4882a593Smuzhiyun (e.g. /usr/src/linux-2.5.73) 37*4882a593Smuzhiyun2) make menuconfig (or make xconfig) 38*4882a593Smuzhiyun3) select cifs from within the network filesystem choices 39*4882a593Smuzhiyun4) save and exit 40*4882a593Smuzhiyun5) make 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun 43*4882a593SmuzhiyunInstallation instructions 44*4882a593Smuzhiyun========================= 45*4882a593Smuzhiyun 46*4882a593SmuzhiyunIf you have built the CIFS vfs as module (successfully) simply 47*4882a593Smuzhiyuntype ``make modules_install`` (or if you prefer, manually copy the file to 48*4882a593Smuzhiyunthe modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.ko). 49*4882a593Smuzhiyun 50*4882a593SmuzhiyunIf you have built the CIFS vfs into the kernel itself, follow the instructions 51*4882a593Smuzhiyunfor your distribution on how to install a new kernel (usually you 52*4882a593Smuzhiyunwould simply type ``make install``). 53*4882a593Smuzhiyun 54*4882a593SmuzhiyunIf you do not have the utility mount.cifs (in the Samba 4.x source tree and on 55*4882a593Smuzhiyunthe CIFS VFS web site) copy it to the same directory in which mount helpers 56*4882a593Smuzhiyunreside (usually /sbin). Although the helper software is not 57*4882a593Smuzhiyunrequired, mount.cifs is recommended. Most distros include a ``cifs-utils`` 58*4882a593Smuzhiyunpackage that includes this utility so it is recommended to install this. 59*4882a593Smuzhiyun 60*4882a593SmuzhiyunNote that running the Winbind pam/nss module (logon service) on all of your 61*4882a593SmuzhiyunLinux clients is useful in mapping Uids and Gids consistently across the 62*4882a593Smuzhiyundomain to the proper network user. The mount.cifs mount helper can be 63*4882a593Smuzhiyunfound at cifs-utils.git on git.samba.org 64*4882a593Smuzhiyun 65*4882a593SmuzhiyunIf cifs is built as a module, then the size and number of network buffers 66*4882a593Smuzhiyunand maximum number of simultaneous requests to one server can be configured. 67*4882a593SmuzhiyunChanging these from their defaults is not recommended. By executing modinfo:: 68*4882a593Smuzhiyun 69*4882a593Smuzhiyun modinfo kernel/fs/cifs/cifs.ko 70*4882a593Smuzhiyun 71*4882a593Smuzhiyunon kernel/fs/cifs/cifs.ko the list of configuration changes that can be made 72*4882a593Smuzhiyunat module initialization time (by running insmod cifs.ko) can be seen. 73*4882a593Smuzhiyun 74*4882a593SmuzhiyunRecommendations 75*4882a593Smuzhiyun=============== 76*4882a593Smuzhiyun 77*4882a593SmuzhiyunTo improve security the SMB2.1 dialect or later (usually will get SMB3) is now 78*4882a593Smuzhiyunthe new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0" 79*4882a593Smuzhiyunon mount (or vers=2.0 for Windows Vista). Note that the CIFS (vers=1.0) is 80*4882a593Smuzhiyunmuch older and less secure than the default dialect SMB3 which includes 81*4882a593Smuzhiyunmany advanced security features such as downgrade attack detection 82*4882a593Smuzhiyunand encrypted shares and stronger signing and authentication algorithms. 83*4882a593SmuzhiyunThere are additional mount options that may be helpful for SMB3 to get 84*4882a593Smuzhiyunimproved POSIX behavior (NB: can use vers=3.0 to force only SMB3, never 2.1): 85*4882a593Smuzhiyun 86*4882a593Smuzhiyun ``mfsymlinks`` and ``cifsacl`` and ``idsfromsid`` 87*4882a593Smuzhiyun 88*4882a593SmuzhiyunAllowing User Mounts 89*4882a593Smuzhiyun==================== 90*4882a593Smuzhiyun 91*4882a593SmuzhiyunTo permit users to mount and unmount over directories they own is possible 92*4882a593Smuzhiyunwith the cifs vfs. A way to enable such mounting is to mark the mount.cifs 93*4882a593Smuzhiyunutility as suid (e.g. ``chmod +s /sbin/mount.cifs``). To enable users to 94*4882a593Smuzhiyunumount shares they mount requires 95*4882a593Smuzhiyun 96*4882a593Smuzhiyun1) mount.cifs version 1.4 or later 97*4882a593Smuzhiyun2) an entry for the share in /etc/fstab indicating that a user may 98*4882a593Smuzhiyun unmount it e.g.:: 99*4882a593Smuzhiyun 100*4882a593Smuzhiyun //server/usersharename /mnt/username cifs user 0 0 101*4882a593Smuzhiyun 102*4882a593SmuzhiyunNote that when the mount.cifs utility is run suid (allowing user mounts), 103*4882a593Smuzhiyunin order to reduce risks, the ``nosuid`` mount flag is passed in on mount to 104*4882a593Smuzhiyundisallow execution of an suid program mounted on the remote target. 105*4882a593SmuzhiyunWhen mount is executed as root, nosuid is not passed in by default, 106*4882a593Smuzhiyunand execution of suid programs on the remote target would be enabled 107*4882a593Smuzhiyunby default. This can be changed, as with nfs and other filesystems, 108*4882a593Smuzhiyunby simply specifying ``nosuid`` among the mount options. For user mounts 109*4882a593Smuzhiyunthough to be able to pass the suid flag to mount requires rebuilding 110*4882a593Smuzhiyunmount.cifs with the following flag: CIFS_ALLOW_USR_SUID 111*4882a593Smuzhiyun 112*4882a593SmuzhiyunThere is a corresponding manual page for cifs mounting in the Samba 3.0 and 113*4882a593Smuzhiyunlater source tree in docs/manpages/mount.cifs.8 114*4882a593Smuzhiyun 115*4882a593SmuzhiyunAllowing User Unmounts 116*4882a593Smuzhiyun====================== 117*4882a593Smuzhiyun 118*4882a593SmuzhiyunTo permit users to ummount directories that they have user mounted (see above), 119*4882a593Smuzhiyunthe utility umount.cifs may be used. It may be invoked directly, or if 120*4882a593Smuzhiyunumount.cifs is placed in /sbin, umount can invoke the cifs umount helper 121*4882a593Smuzhiyun(at least for most versions of the umount utility) for umount of cifs 122*4882a593Smuzhiyunmounts, unless umount is invoked with -i (which will avoid invoking a umount 123*4882a593Smuzhiyunhelper). As with mount.cifs, to enable user unmounts umount.cifs must be marked 124*4882a593Smuzhiyunas suid (e.g. ``chmod +s /sbin/umount.cifs``) or equivalent (some distributions 125*4882a593Smuzhiyunallow adding entries to a file to the /etc/permissions file to achieve the 126*4882a593Smuzhiyunequivalent suid effect). For this utility to succeed the target path 127*4882a593Smuzhiyunmust be a cifs mount, and the uid of the current user must match the uid 128*4882a593Smuzhiyunof the user who mounted the resource. 129*4882a593Smuzhiyun 130*4882a593SmuzhiyunAlso note that the customary way of allowing user mounts and unmounts is 131*4882a593Smuzhiyun(instead of using mount.cifs and unmount.cifs as suid) to add a line 132*4882a593Smuzhiyunto the file /etc/fstab for each //server/share you wish to mount, but 133*4882a593Smuzhiyunthis can become unwieldy when potential mount targets include many 134*4882a593Smuzhiyunor unpredictable UNC names. 135*4882a593Smuzhiyun 136*4882a593SmuzhiyunSamba Considerations 137*4882a593Smuzhiyun==================== 138*4882a593Smuzhiyun 139*4882a593SmuzhiyunMost current servers support SMB2.1 and SMB3 which are more secure, 140*4882a593Smuzhiyunbut there are useful protocol extensions for the older less secure CIFS 141*4882a593Smuzhiyundialect, so to get the maximum benefit if mounting using the older dialect 142*4882a593Smuzhiyun(CIFS/SMB1), we recommend using a server that supports the SNIA CIFS 143*4882a593SmuzhiyunUnix Extensions standard (e.g. almost any version of Samba ie version 144*4882a593Smuzhiyun2.2.5 or later) but the CIFS vfs works fine with a wide variety of CIFS servers. 145*4882a593SmuzhiyunNote that uid, gid and file permissions will display default values if you do 146*4882a593Smuzhiyunnot have a server that supports the Unix extensions for CIFS (such as Samba 147*4882a593Smuzhiyun2.2.5 or later). To enable the Unix CIFS Extensions in the Samba server, add 148*4882a593Smuzhiyunthe line:: 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun unix extensions = yes 151*4882a593Smuzhiyun 152*4882a593Smuzhiyunto your smb.conf file on the server. Note that the following smb.conf settings 153*4882a593Smuzhiyunare also useful (on the Samba server) when the majority of clients are Unix or 154*4882a593SmuzhiyunLinux:: 155*4882a593Smuzhiyun 156*4882a593Smuzhiyun case sensitive = yes 157*4882a593Smuzhiyun delete readonly = yes 158*4882a593Smuzhiyun ea support = yes 159*4882a593Smuzhiyun 160*4882a593SmuzhiyunNote that server ea support is required for supporting xattrs from the Linux 161*4882a593Smuzhiyuncifs client, and that EA support is present in later versions of Samba (e.g. 162*4882a593Smuzhiyun3.0.6 and later (also EA support works in all versions of Windows, at least to 163*4882a593Smuzhiyunshares on NTFS filesystems). Extended Attribute (xattr) support is an optional 164*4882a593Smuzhiyunfeature of most Linux filesystems which may require enabling via 165*4882a593Smuzhiyunmake menuconfig. Client support for extended attributes (user xattr) can be 166*4882a593Smuzhiyundisabled on a per-mount basis by specifying ``nouser_xattr`` on mount. 167*4882a593Smuzhiyun 168*4882a593SmuzhiyunThe CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers 169*4882a593Smuzhiyunversion 3.10 and later. Setting POSIX ACLs requires enabling both XATTR and 170*4882a593Smuzhiyunthen POSIX support in the CIFS configuration options when building the cifs 171*4882a593Smuzhiyunmodule. POSIX ACL support can be disabled on a per mount basic by specifying 172*4882a593Smuzhiyun``noacl`` on mount. 173*4882a593Smuzhiyun 174*4882a593SmuzhiyunSome administrators may want to change Samba's smb.conf ``map archive`` and 175*4882a593Smuzhiyun``create mask`` parameters from the default. Unless the create mask is changed 176*4882a593Smuzhiyunnewly created files can end up with an unnecessarily restrictive default mode, 177*4882a593Smuzhiyunwhich may not be what you want, although if the CIFS Unix extensions are 178*4882a593Smuzhiyunenabled on the server and client, subsequent setattr calls (e.g. chmod) can 179*4882a593Smuzhiyunfix the mode. Note that creating special devices (mknod) remotely 180*4882a593Smuzhiyunmay require specifying a mkdev function to Samba if you are not using 181*4882a593SmuzhiyunSamba 3.0.6 or later. For more information on these see the manual pages 182*4882a593Smuzhiyun(``man smb.conf``) on the Samba server system. Note that the cifs vfs, 183*4882a593Smuzhiyununlike the smbfs vfs, does not read the smb.conf on the client system 184*4882a593Smuzhiyun(the few optional settings are passed in on mount via -o parameters instead). 185*4882a593SmuzhiyunNote that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete 186*4882a593Smuzhiyunopen files (required for strict POSIX compliance). Windows Servers already 187*4882a593Smuzhiyunsupported this feature. Samba server does not allow symlinks that refer to files 188*4882a593Smuzhiyunoutside of the share, so in Samba versions prior to 3.0.6, most symlinks to 189*4882a593Smuzhiyunfiles with absolute paths (ie beginning with slash) such as:: 190*4882a593Smuzhiyun 191*4882a593Smuzhiyun ln -s /mnt/foo bar 192*4882a593Smuzhiyun 193*4882a593Smuzhiyunwould be forbidden. Samba 3.0.6 server or later includes the ability to create 194*4882a593Smuzhiyunsuch symlinks safely by converting unsafe symlinks (ie symlinks to server 195*4882a593Smuzhiyunfiles that are outside of the share) to a samba specific format on the server 196*4882a593Smuzhiyunthat is ignored by local server applications and non-cifs clients and that will 197*4882a593Smuzhiyunnot be traversed by the Samba server). This is opaque to the Linux client 198*4882a593Smuzhiyunapplication using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 or 199*4882a593Smuzhiyunlater, but only for remote clients using the CIFS Unix extensions, and will 200*4882a593Smuzhiyunbe invisbile to Windows clients and typically will not affect local 201*4882a593Smuzhiyunapplications running on the same server as Samba. 202*4882a593Smuzhiyun 203*4882a593SmuzhiyunUse instructions 204*4882a593Smuzhiyun================ 205*4882a593Smuzhiyun 206*4882a593SmuzhiyunOnce the CIFS VFS support is built into the kernel or installed as a module 207*4882a593Smuzhiyun(cifs.ko), you can use mount syntax like the following to access Samba or 208*4882a593SmuzhiyunMac or Windows servers:: 209*4882a593Smuzhiyun 210*4882a593Smuzhiyun mount -t cifs //9.53.216.11/e$ /mnt -o username=myname,password=mypassword 211*4882a593Smuzhiyun 212*4882a593SmuzhiyunBefore -o the option -v may be specified to make the mount.cifs 213*4882a593Smuzhiyunmount helper display the mount steps more verbosely. 214*4882a593SmuzhiyunAfter -o the following commonly used cifs vfs specific options 215*4882a593Smuzhiyunare supported:: 216*4882a593Smuzhiyun 217*4882a593Smuzhiyun username=<username> 218*4882a593Smuzhiyun password=<password> 219*4882a593Smuzhiyun domain=<domain name> 220*4882a593Smuzhiyun 221*4882a593SmuzhiyunOther cifs mount options are described below. Use of TCP names (in addition to 222*4882a593Smuzhiyunip addresses) is available if the mount helper (mount.cifs) is installed. If 223*4882a593Smuzhiyunyou do not trust the server to which are mounted, or if you do not have 224*4882a593Smuzhiyuncifs signing enabled (and the physical network is insecure), consider use 225*4882a593Smuzhiyunof the standard mount options ``noexec`` and ``nosuid`` to reduce the risk of 226*4882a593Smuzhiyunrunning an altered binary on your local system (downloaded from a hostile server 227*4882a593Smuzhiyunor altered by a hostile router). 228*4882a593Smuzhiyun 229*4882a593SmuzhiyunAlthough mounting using format corresponding to the CIFS URL specification is 230*4882a593Smuzhiyunnot possible in mount.cifs yet, it is possible to use an alternate format 231*4882a593Smuzhiyunfor the server and sharename (which is somewhat similar to NFS style mount 232*4882a593Smuzhiyunsyntax) instead of the more widely used UNC format (i.e. \\server\share):: 233*4882a593Smuzhiyun 234*4882a593Smuzhiyun mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswd 235*4882a593Smuzhiyun 236*4882a593SmuzhiyunWhen using the mount helper mount.cifs, passwords may be specified via alternate 237*4882a593Smuzhiyunmechanisms, instead of specifying it after -o using the normal ``pass=`` syntax 238*4882a593Smuzhiyunon the command line: 239*4882a593Smuzhiyun1) By including it in a credential file. Specify credentials=filename as one 240*4882a593Smuzhiyunof the mount options. Credential files contain two lines:: 241*4882a593Smuzhiyun 242*4882a593Smuzhiyun username=someuser 243*4882a593Smuzhiyun password=your_password 244*4882a593Smuzhiyun 245*4882a593Smuzhiyun2) By specifying the password in the PASSWD environment variable (similarly 246*4882a593Smuzhiyun the user name can be taken from the USER environment variable). 247*4882a593Smuzhiyun3) By specifying the password in a file by name via PASSWD_FILE 248*4882a593Smuzhiyun4) By specifying the password in a file by file descriptor via PASSWD_FD 249*4882a593Smuzhiyun 250*4882a593SmuzhiyunIf no password is provided, mount.cifs will prompt for password entry 251*4882a593Smuzhiyun 252*4882a593SmuzhiyunRestrictions 253*4882a593Smuzhiyun============ 254*4882a593Smuzhiyun 255*4882a593SmuzhiyunServers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC 256*4882a593Smuzhiyun1001/1002 support for "Netbios-Over-TCP/IP." This is not likely to be a 257*4882a593Smuzhiyunproblem as most servers support this. 258*4882a593Smuzhiyun 259*4882a593SmuzhiyunValid filenames differ between Windows and Linux. Windows typically restricts 260*4882a593Smuzhiyunfilenames which contain certain reserved characters (e.g.the character : 261*4882a593Smuzhiyunwhich is used to delimit the beginning of a stream name by Windows), while 262*4882a593SmuzhiyunLinux allows a slightly wider set of valid characters in filenames. Windows 263*4882a593Smuzhiyunservers can remap such characters when an explicit mapping is specified in 264*4882a593Smuzhiyunthe Server's registry. Samba starting with version 3.10 will allow such 265*4882a593Smuzhiyunfilenames (ie those which contain valid Linux characters, which normally 266*4882a593Smuzhiyunwould be forbidden for Windows/CIFS semantics) as long as the server is 267*4882a593Smuzhiyunconfigured for Unix Extensions (and the client has not disabled 268*4882a593Smuzhiyun/proc/fs/cifs/LinuxExtensionsEnabled). In addition the mount option 269*4882a593Smuzhiyun``mapposix`` can be used on CIFS (vers=1.0) to force the mapping of 270*4882a593Smuzhiyunillegal Windows/NTFS/SMB characters to a remap range (this mount parm 271*4882a593Smuzhiyunis the default for SMB3). This remap (``mapposix``) range is also 272*4882a593Smuzhiyuncompatible with Mac (and "Services for Mac" on some older Windows). 273*4882a593Smuzhiyun 274*4882a593SmuzhiyunCIFS VFS Mount Options 275*4882a593Smuzhiyun====================== 276*4882a593SmuzhiyunA partial list of the supported mount options follows: 277*4882a593Smuzhiyun 278*4882a593Smuzhiyun username 279*4882a593Smuzhiyun The user name to use when trying to establish 280*4882a593Smuzhiyun the CIFS session. 281*4882a593Smuzhiyun password 282*4882a593Smuzhiyun The user password. If the mount helper is 283*4882a593Smuzhiyun installed, the user will be prompted for password 284*4882a593Smuzhiyun if not supplied. 285*4882a593Smuzhiyun ip 286*4882a593Smuzhiyun The ip address of the target server 287*4882a593Smuzhiyun unc 288*4882a593Smuzhiyun The target server Universal Network Name (export) to 289*4882a593Smuzhiyun mount. 290*4882a593Smuzhiyun domain 291*4882a593Smuzhiyun Set the SMB/CIFS workgroup name prepended to the 292*4882a593Smuzhiyun username during CIFS session establishment 293*4882a593Smuzhiyun forceuid 294*4882a593Smuzhiyun Set the default uid for inodes to the uid 295*4882a593Smuzhiyun passed in on mount. For mounts to servers 296*4882a593Smuzhiyun which do support the CIFS Unix extensions, such as a 297*4882a593Smuzhiyun properly configured Samba server, the server provides 298*4882a593Smuzhiyun the uid, gid and mode so this parameter should not be 299*4882a593Smuzhiyun specified unless the server and clients uid and gid 300*4882a593Smuzhiyun numbering differ. If the server and client are in the 301*4882a593Smuzhiyun same domain (e.g. running winbind or nss_ldap) and 302*4882a593Smuzhiyun the server supports the Unix Extensions then the uid 303*4882a593Smuzhiyun and gid can be retrieved from the server (and uid 304*4882a593Smuzhiyun and gid would not have to be specified on the mount. 305*4882a593Smuzhiyun For servers which do not support the CIFS Unix 306*4882a593Smuzhiyun extensions, the default uid (and gid) returned on lookup 307*4882a593Smuzhiyun of existing files will be the uid (gid) of the person 308*4882a593Smuzhiyun who executed the mount (root, except when mount.cifs 309*4882a593Smuzhiyun is configured setuid for user mounts) unless the ``uid=`` 310*4882a593Smuzhiyun (gid) mount option is specified. Also note that permission 311*4882a593Smuzhiyun checks (authorization checks) on accesses to a file occur 312*4882a593Smuzhiyun at the server, but there are cases in which an administrator 313*4882a593Smuzhiyun may want to restrict at the client as well. For those 314*4882a593Smuzhiyun servers which do not report a uid/gid owner 315*4882a593Smuzhiyun (such as Windows), permissions can also be checked at the 316*4882a593Smuzhiyun client, and a crude form of client side permission checking 317*4882a593Smuzhiyun can be enabled by specifying file_mode and dir_mode on 318*4882a593Smuzhiyun the client. (default) 319*4882a593Smuzhiyun forcegid 320*4882a593Smuzhiyun (similar to above but for the groupid instead of uid) (default) 321*4882a593Smuzhiyun noforceuid 322*4882a593Smuzhiyun Fill in file owner information (uid) by requesting it from 323*4882a593Smuzhiyun the server if possible. With this option, the value given in 324*4882a593Smuzhiyun the uid= option (on mount) will only be used if the server 325*4882a593Smuzhiyun can not support returning uids on inodes. 326*4882a593Smuzhiyun noforcegid 327*4882a593Smuzhiyun (similar to above but for the group owner, gid, instead of uid) 328*4882a593Smuzhiyun uid 329*4882a593Smuzhiyun Set the default uid for inodes, and indicate to the 330*4882a593Smuzhiyun cifs kernel driver which local user mounted. If the server 331*4882a593Smuzhiyun supports the unix extensions the default uid is 332*4882a593Smuzhiyun not used to fill in the owner fields of inodes (files) 333*4882a593Smuzhiyun unless the ``forceuid`` parameter is specified. 334*4882a593Smuzhiyun gid 335*4882a593Smuzhiyun Set the default gid for inodes (similar to above). 336*4882a593Smuzhiyun file_mode 337*4882a593Smuzhiyun If CIFS Unix extensions are not supported by the server 338*4882a593Smuzhiyun this overrides the default mode for file inodes. 339*4882a593Smuzhiyun fsc 340*4882a593Smuzhiyun Enable local disk caching using FS-Cache (off by default). This 341*4882a593Smuzhiyun option could be useful to improve performance on a slow link, 342*4882a593Smuzhiyun heavily loaded server and/or network where reading from the 343*4882a593Smuzhiyun disk is faster than reading from the server (over the network). 344*4882a593Smuzhiyun This could also impact scalability positively as the 345*4882a593Smuzhiyun number of calls to the server are reduced. However, local 346*4882a593Smuzhiyun caching is not suitable for all workloads for e.g. read-once 347*4882a593Smuzhiyun type workloads. So, you need to consider carefully your 348*4882a593Smuzhiyun workload/scenario before using this option. Currently, local 349*4882a593Smuzhiyun disk caching is functional for CIFS files opened as read-only. 350*4882a593Smuzhiyun dir_mode 351*4882a593Smuzhiyun If CIFS Unix extensions are not supported by the server 352*4882a593Smuzhiyun this overrides the default mode for directory inodes. 353*4882a593Smuzhiyun port 354*4882a593Smuzhiyun attempt to contact the server on this tcp port, before 355*4882a593Smuzhiyun trying the usual ports (port 445, then 139). 356*4882a593Smuzhiyun iocharset 357*4882a593Smuzhiyun Codepage used to convert local path names to and from 358*4882a593Smuzhiyun Unicode. Unicode is used by default for network path 359*4882a593Smuzhiyun names if the server supports it. If iocharset is 360*4882a593Smuzhiyun not specified then the nls_default specified 361*4882a593Smuzhiyun during the local client kernel build will be used. 362*4882a593Smuzhiyun If server does not support Unicode, this parameter is 363*4882a593Smuzhiyun unused. 364*4882a593Smuzhiyun rsize 365*4882a593Smuzhiyun default read size (usually 16K). The client currently 366*4882a593Smuzhiyun can not use rsize larger than CIFSMaxBufSize. CIFSMaxBufSize 367*4882a593Smuzhiyun defaults to 16K and may be changed (from 8K to the maximum 368*4882a593Smuzhiyun kmalloc size allowed by your kernel) at module install time 369*4882a593Smuzhiyun for cifs.ko. Setting CIFSMaxBufSize to a very large value 370*4882a593Smuzhiyun will cause cifs to use more memory and may reduce performance 371*4882a593Smuzhiyun in some cases. To use rsize greater than 127K (the original 372*4882a593Smuzhiyun cifs protocol maximum) also requires that the server support 373*4882a593Smuzhiyun a new Unix Capability flag (for very large read) which some 374*4882a593Smuzhiyun newer servers (e.g. Samba 3.0.26 or later) do. rsize can be 375*4882a593Smuzhiyun set from a minimum of 2048 to a maximum of 130048 (127K or 376*4882a593Smuzhiyun CIFSMaxBufSize, whichever is smaller) 377*4882a593Smuzhiyun wsize 378*4882a593Smuzhiyun default write size (default 57344) 379*4882a593Smuzhiyun maximum wsize currently allowed by CIFS is 57344 (fourteen 380*4882a593Smuzhiyun 4096 byte pages) 381*4882a593Smuzhiyun actimeo=n 382*4882a593Smuzhiyun attribute cache timeout in seconds (default 1 second). 383*4882a593Smuzhiyun After this timeout, the cifs client requests fresh attribute 384*4882a593Smuzhiyun information from the server. This option allows to tune the 385*4882a593Smuzhiyun attribute cache timeout to suit the workload needs. Shorter 386*4882a593Smuzhiyun timeouts mean better the cache coherency, but increased number 387*4882a593Smuzhiyun of calls to the server. Longer timeouts mean reduced number 388*4882a593Smuzhiyun of calls to the server at the expense of less stricter cache 389*4882a593Smuzhiyun coherency checks (i.e. incorrect attribute cache for a short 390*4882a593Smuzhiyun period of time). 391*4882a593Smuzhiyun rw 392*4882a593Smuzhiyun mount the network share read-write (note that the 393*4882a593Smuzhiyun server may still consider the share read-only) 394*4882a593Smuzhiyun ro 395*4882a593Smuzhiyun mount network share read-only 396*4882a593Smuzhiyun version 397*4882a593Smuzhiyun used to distinguish different versions of the 398*4882a593Smuzhiyun mount helper utility (not typically needed) 399*4882a593Smuzhiyun sep 400*4882a593Smuzhiyun if first mount option (after the -o), overrides 401*4882a593Smuzhiyun the comma as the separator between the mount 402*4882a593Smuzhiyun parms. e.g.:: 403*4882a593Smuzhiyun 404*4882a593Smuzhiyun -o user=myname,password=mypassword,domain=mydom 405*4882a593Smuzhiyun 406*4882a593Smuzhiyun could be passed instead with period as the separator by:: 407*4882a593Smuzhiyun 408*4882a593Smuzhiyun -o sep=.user=myname.password=mypassword.domain=mydom 409*4882a593Smuzhiyun 410*4882a593Smuzhiyun this might be useful when comma is contained within username 411*4882a593Smuzhiyun or password or domain. This option is less important 412*4882a593Smuzhiyun when the cifs mount helper cifs.mount (version 1.1 or later) 413*4882a593Smuzhiyun is used. 414*4882a593Smuzhiyun nosuid 415*4882a593Smuzhiyun Do not allow remote executables with the suid bit 416*4882a593Smuzhiyun program to be executed. This is only meaningful for mounts 417*4882a593Smuzhiyun to servers such as Samba which support the CIFS Unix Extensions. 418*4882a593Smuzhiyun If you do not trust the servers in your network (your mount 419*4882a593Smuzhiyun targets) it is recommended that you specify this option for 420*4882a593Smuzhiyun greater security. 421*4882a593Smuzhiyun exec 422*4882a593Smuzhiyun Permit execution of binaries on the mount. 423*4882a593Smuzhiyun noexec 424*4882a593Smuzhiyun Do not permit execution of binaries on the mount. 425*4882a593Smuzhiyun dev 426*4882a593Smuzhiyun Recognize block devices on the remote mount. 427*4882a593Smuzhiyun nodev 428*4882a593Smuzhiyun Do not recognize devices on the remote mount. 429*4882a593Smuzhiyun suid 430*4882a593Smuzhiyun Allow remote files on this mountpoint with suid enabled to 431*4882a593Smuzhiyun be executed (default for mounts when executed as root, 432*4882a593Smuzhiyun nosuid is default for user mounts). 433*4882a593Smuzhiyun credentials 434*4882a593Smuzhiyun Although ignored by the cifs kernel component, it is used by 435*4882a593Smuzhiyun the mount helper, mount.cifs. When mount.cifs is installed it 436*4882a593Smuzhiyun opens and reads the credential file specified in order 437*4882a593Smuzhiyun to obtain the userid and password arguments which are passed to 438*4882a593Smuzhiyun the cifs vfs. 439*4882a593Smuzhiyun guest 440*4882a593Smuzhiyun Although ignored by the kernel component, the mount.cifs 441*4882a593Smuzhiyun mount helper will not prompt the user for a password 442*4882a593Smuzhiyun if guest is specified on the mount options. If no 443*4882a593Smuzhiyun password is specified a null password will be used. 444*4882a593Smuzhiyun perm 445*4882a593Smuzhiyun Client does permission checks (vfs_permission check of uid 446*4882a593Smuzhiyun and gid of the file against the mode and desired operation), 447*4882a593Smuzhiyun Note that this is in addition to the normal ACL check on the 448*4882a593Smuzhiyun target machine done by the server software. 449*4882a593Smuzhiyun Client permission checking is enabled by default. 450*4882a593Smuzhiyun noperm 451*4882a593Smuzhiyun Client does not do permission checks. This can expose 452*4882a593Smuzhiyun files on this mount to access by other users on the local 453*4882a593Smuzhiyun client system. It is typically only needed when the server 454*4882a593Smuzhiyun supports the CIFS Unix Extensions but the UIDs/GIDs on the 455*4882a593Smuzhiyun client and server system do not match closely enough to allow 456*4882a593Smuzhiyun access by the user doing the mount, but it may be useful with 457*4882a593Smuzhiyun non CIFS Unix Extension mounts for cases in which the default 458*4882a593Smuzhiyun mode is specified on the mount but is not to be enforced on the 459*4882a593Smuzhiyun client (e.g. perhaps when MultiUserMount is enabled) 460*4882a593Smuzhiyun Note that this does not affect the normal ACL check on the 461*4882a593Smuzhiyun target machine done by the server software (of the server 462*4882a593Smuzhiyun ACL against the user name provided at mount time). 463*4882a593Smuzhiyun serverino 464*4882a593Smuzhiyun Use server's inode numbers instead of generating automatically 465*4882a593Smuzhiyun incrementing inode numbers on the client. Although this will 466*4882a593Smuzhiyun make it easier to spot hardlinked files (as they will have 467*4882a593Smuzhiyun the same inode numbers) and inode numbers may be persistent, 468*4882a593Smuzhiyun note that the server does not guarantee that the inode numbers 469*4882a593Smuzhiyun are unique if multiple server side mounts are exported under a 470*4882a593Smuzhiyun single share (since inode numbers on the servers might not 471*4882a593Smuzhiyun be unique if multiple filesystems are mounted under the same 472*4882a593Smuzhiyun shared higher level directory). Note that some older 473*4882a593Smuzhiyun (e.g. pre-Windows 2000) do not support returning UniqueIDs 474*4882a593Smuzhiyun or the CIFS Unix Extensions equivalent and for those 475*4882a593Smuzhiyun this mount option will have no effect. Exporting cifs mounts 476*4882a593Smuzhiyun under nfsd requires this mount option on the cifs mount. 477*4882a593Smuzhiyun This is now the default if server supports the 478*4882a593Smuzhiyun required network operation. 479*4882a593Smuzhiyun noserverino 480*4882a593Smuzhiyun Client generates inode numbers (rather than using the actual one 481*4882a593Smuzhiyun from the server). These inode numbers will vary after 482*4882a593Smuzhiyun unmount or reboot which can confuse some applications, 483*4882a593Smuzhiyun but not all server filesystems support unique inode 484*4882a593Smuzhiyun numbers. 485*4882a593Smuzhiyun setuids 486*4882a593Smuzhiyun If the CIFS Unix extensions are negotiated with the server 487*4882a593Smuzhiyun the client will attempt to set the effective uid and gid of 488*4882a593Smuzhiyun the local process on newly created files, directories, and 489*4882a593Smuzhiyun devices (create, mkdir, mknod). If the CIFS Unix Extensions 490*4882a593Smuzhiyun are not negotiated, for newly created files and directories 491*4882a593Smuzhiyun instead of using the default uid and gid specified on 492*4882a593Smuzhiyun the mount, cache the new file's uid and gid locally which means 493*4882a593Smuzhiyun that the uid for the file can change when the inode is 494*4882a593Smuzhiyun reloaded (or the user remounts the share). 495*4882a593Smuzhiyun nosetuids 496*4882a593Smuzhiyun The client will not attempt to set the uid and gid on 497*4882a593Smuzhiyun on newly created files, directories, and devices (create, 498*4882a593Smuzhiyun mkdir, mknod) which will result in the server setting the 499*4882a593Smuzhiyun uid and gid to the default (usually the server uid of the 500*4882a593Smuzhiyun user who mounted the share). Letting the server (rather than 501*4882a593Smuzhiyun the client) set the uid and gid is the default. If the CIFS 502*4882a593Smuzhiyun Unix Extensions are not negotiated then the uid and gid for 503*4882a593Smuzhiyun new files will appear to be the uid (gid) of the mounter or the 504*4882a593Smuzhiyun uid (gid) parameter specified on the mount. 505*4882a593Smuzhiyun netbiosname 506*4882a593Smuzhiyun When mounting to servers via port 139, specifies the RFC1001 507*4882a593Smuzhiyun source name to use to represent the client netbios machine 508*4882a593Smuzhiyun name when doing the RFC1001 netbios session initialize. 509*4882a593Smuzhiyun direct 510*4882a593Smuzhiyun Do not do inode data caching on files opened on this mount. 511*4882a593Smuzhiyun This precludes mmapping files on this mount. In some cases 512*4882a593Smuzhiyun with fast networks and little or no caching benefits on the 513*4882a593Smuzhiyun client (e.g. when the application is doing large sequential 514*4882a593Smuzhiyun reads bigger than page size without rereading the same data) 515*4882a593Smuzhiyun this can provide better performance than the default 516*4882a593Smuzhiyun behavior which caches reads (readahead) and writes 517*4882a593Smuzhiyun (writebehind) through the local Linux client pagecache 518*4882a593Smuzhiyun if oplock (caching token) is granted and held. Note that 519*4882a593Smuzhiyun direct allows write operations larger than page size 520*4882a593Smuzhiyun to be sent to the server. 521*4882a593Smuzhiyun strictcache 522*4882a593Smuzhiyun Use for switching on strict cache mode. In this mode the 523*4882a593Smuzhiyun client read from the cache all the time it has Oplock Level II, 524*4882a593Smuzhiyun otherwise - read from the server. All written data are stored 525*4882a593Smuzhiyun in the cache, but if the client doesn't have Exclusive Oplock, 526*4882a593Smuzhiyun it writes the data to the server. 527*4882a593Smuzhiyun rwpidforward 528*4882a593Smuzhiyun Forward pid of a process who opened a file to any read or write 529*4882a593Smuzhiyun operation on that file. This prevent applications like WINE 530*4882a593Smuzhiyun from failing on read and write if we use mandatory brlock style. 531*4882a593Smuzhiyun acl 532*4882a593Smuzhiyun Allow setfacl and getfacl to manage posix ACLs if server 533*4882a593Smuzhiyun supports them. (default) 534*4882a593Smuzhiyun noacl 535*4882a593Smuzhiyun Do not allow setfacl and getfacl calls on this mount 536*4882a593Smuzhiyun user_xattr 537*4882a593Smuzhiyun Allow getting and setting user xattrs (those attributes whose 538*4882a593Smuzhiyun name begins with ``user.`` or ``os2.``) as OS/2 EAs (extended 539*4882a593Smuzhiyun attributes) to the server. This allows support of the 540*4882a593Smuzhiyun setfattr and getfattr utilities. (default) 541*4882a593Smuzhiyun nouser_xattr 542*4882a593Smuzhiyun Do not allow getfattr/setfattr to get/set/list xattrs 543*4882a593Smuzhiyun mapchars 544*4882a593Smuzhiyun Translate six of the seven reserved characters (not backslash):: 545*4882a593Smuzhiyun 546*4882a593Smuzhiyun *?<>|: 547*4882a593Smuzhiyun 548*4882a593Smuzhiyun to the remap range (above 0xF000), which also 549*4882a593Smuzhiyun allows the CIFS client to recognize files created with 550*4882a593Smuzhiyun such characters by Windows's POSIX emulation. This can 551*4882a593Smuzhiyun also be useful when mounting to most versions of Samba 552*4882a593Smuzhiyun (which also forbids creating and opening files 553*4882a593Smuzhiyun whose names contain any of these seven characters). 554*4882a593Smuzhiyun This has no effect if the server does not support 555*4882a593Smuzhiyun Unicode on the wire. 556*4882a593Smuzhiyun nomapchars 557*4882a593Smuzhiyun Do not translate any of these seven characters (default). 558*4882a593Smuzhiyun nocase 559*4882a593Smuzhiyun Request case insensitive path name matching (case 560*4882a593Smuzhiyun sensitive is the default if the server supports it). 561*4882a593Smuzhiyun (mount option ``ignorecase`` is identical to ``nocase``) 562*4882a593Smuzhiyun posixpaths 563*4882a593Smuzhiyun If CIFS Unix extensions are supported, attempt to 564*4882a593Smuzhiyun negotiate posix path name support which allows certain 565*4882a593Smuzhiyun characters forbidden in typical CIFS filenames, without 566*4882a593Smuzhiyun requiring remapping. (default) 567*4882a593Smuzhiyun noposixpaths 568*4882a593Smuzhiyun If CIFS Unix extensions are supported, do not request 569*4882a593Smuzhiyun posix path name support (this may cause servers to 570*4882a593Smuzhiyun reject creatingfile with certain reserved characters). 571*4882a593Smuzhiyun nounix 572*4882a593Smuzhiyun Disable the CIFS Unix Extensions for this mount (tree 573*4882a593Smuzhiyun connection). This is rarely needed, but it may be useful 574*4882a593Smuzhiyun in order to turn off multiple settings all at once (ie 575*4882a593Smuzhiyun posix acls, posix locks, posix paths, symlink support 576*4882a593Smuzhiyun and retrieving uids/gids/mode from the server) or to 577*4882a593Smuzhiyun work around a bug in server which implement the Unix 578*4882a593Smuzhiyun Extensions. 579*4882a593Smuzhiyun nobrl 580*4882a593Smuzhiyun Do not send byte range lock requests to the server. 581*4882a593Smuzhiyun This is necessary for certain applications that break 582*4882a593Smuzhiyun with cifs style mandatory byte range locks (and most 583*4882a593Smuzhiyun cifs servers do not yet support requesting advisory 584*4882a593Smuzhiyun byte range locks). 585*4882a593Smuzhiyun forcemandatorylock 586*4882a593Smuzhiyun Even if the server supports posix (advisory) byte range 587*4882a593Smuzhiyun locking, send only mandatory lock requests. For some 588*4882a593Smuzhiyun (presumably rare) applications, originally coded for 589*4882a593Smuzhiyun DOS/Windows, which require Windows style mandatory byte range 590*4882a593Smuzhiyun locking, they may be able to take advantage of this option, 591*4882a593Smuzhiyun forcing the cifs client to only send mandatory locks 592*4882a593Smuzhiyun even if the cifs server would support posix advisory locks. 593*4882a593Smuzhiyun ``forcemand`` is accepted as a shorter form of this mount 594*4882a593Smuzhiyun option. 595*4882a593Smuzhiyun nostrictsync 596*4882a593Smuzhiyun If this mount option is set, when an application does an 597*4882a593Smuzhiyun fsync call then the cifs client does not send an SMB Flush 598*4882a593Smuzhiyun to the server (to force the server to write all dirty data 599*4882a593Smuzhiyun for this file immediately to disk), although cifs still sends 600*4882a593Smuzhiyun all dirty (cached) file data to the server and waits for the 601*4882a593Smuzhiyun server to respond to the write. Since SMB Flush can be 602*4882a593Smuzhiyun very slow, and some servers may be reliable enough (to risk 603*4882a593Smuzhiyun delaying slightly flushing the data to disk on the server), 604*4882a593Smuzhiyun turning on this option may be useful to improve performance for 605*4882a593Smuzhiyun applications that fsync too much, at a small risk of server 606*4882a593Smuzhiyun crash. If this mount option is not set, by default cifs will 607*4882a593Smuzhiyun send an SMB flush request (and wait for a response) on every 608*4882a593Smuzhiyun fsync call. 609*4882a593Smuzhiyun nodfs 610*4882a593Smuzhiyun Disable DFS (global name space support) even if the 611*4882a593Smuzhiyun server claims to support it. This can help work around 612*4882a593Smuzhiyun a problem with parsing of DFS paths with Samba server 613*4882a593Smuzhiyun versions 3.0.24 and 3.0.25. 614*4882a593Smuzhiyun remount 615*4882a593Smuzhiyun remount the share (often used to change from ro to rw mounts 616*4882a593Smuzhiyun or vice versa) 617*4882a593Smuzhiyun cifsacl 618*4882a593Smuzhiyun Report mode bits (e.g. on stat) based on the Windows ACL for 619*4882a593Smuzhiyun the file. (EXPERIMENTAL) 620*4882a593Smuzhiyun servern 621*4882a593Smuzhiyun Specify the server 's netbios name (RFC1001 name) to use 622*4882a593Smuzhiyun when attempting to setup a session to the server. 623*4882a593Smuzhiyun This is needed for mounting to some older servers (such 624*4882a593Smuzhiyun as OS/2 or Windows 98 and Windows ME) since they do not 625*4882a593Smuzhiyun support a default server name. A server name can be up 626*4882a593Smuzhiyun to 15 characters long and is usually uppercased. 627*4882a593Smuzhiyun sfu 628*4882a593Smuzhiyun When the CIFS Unix Extensions are not negotiated, attempt to 629*4882a593Smuzhiyun create device files and fifos in a format compatible with 630*4882a593Smuzhiyun Services for Unix (SFU). In addition retrieve bits 10-12 631*4882a593Smuzhiyun of the mode via the SETFILEBITS extended attribute (as 632*4882a593Smuzhiyun SFU does). In the future the bottom 9 bits of the 633*4882a593Smuzhiyun mode also will be emulated using queries of the security 634*4882a593Smuzhiyun descriptor (ACL). 635*4882a593Smuzhiyun mfsymlinks 636*4882a593Smuzhiyun Enable support for Minshall+French symlinks 637*4882a593Smuzhiyun (see http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks) 638*4882a593Smuzhiyun This option is ignored when specified together with the 639*4882a593Smuzhiyun 'sfu' option. Minshall+French symlinks are used even if 640*4882a593Smuzhiyun the server supports the CIFS Unix Extensions. 641*4882a593Smuzhiyun sign 642*4882a593Smuzhiyun Must use packet signing (helps avoid unwanted data modification 643*4882a593Smuzhiyun by intermediate systems in the route). Note that signing 644*4882a593Smuzhiyun does not work with lanman or plaintext authentication. 645*4882a593Smuzhiyun seal 646*4882a593Smuzhiyun Must seal (encrypt) all data on this mounted share before 647*4882a593Smuzhiyun sending on the network. Requires support for Unix Extensions. 648*4882a593Smuzhiyun Note that this differs from the sign mount option in that it 649*4882a593Smuzhiyun causes encryption of data sent over this mounted share but other 650*4882a593Smuzhiyun shares mounted to the same server are unaffected. 651*4882a593Smuzhiyun locallease 652*4882a593Smuzhiyun This option is rarely needed. Fcntl F_SETLEASE is 653*4882a593Smuzhiyun used by some applications such as Samba and NFSv4 server to 654*4882a593Smuzhiyun check to see whether a file is cacheable. CIFS has no way 655*4882a593Smuzhiyun to explicitly request a lease, but can check whether a file 656*4882a593Smuzhiyun is cacheable (oplocked). Unfortunately, even if a file 657*4882a593Smuzhiyun is not oplocked, it could still be cacheable (ie cifs client 658*4882a593Smuzhiyun could grant fcntl leases if no other local processes are using 659*4882a593Smuzhiyun the file) for cases for example such as when the server does not 660*4882a593Smuzhiyun support oplocks and the user is sure that the only updates to 661*4882a593Smuzhiyun the file will be from this client. Specifying this mount option 662*4882a593Smuzhiyun will allow the cifs client to check for leases (only) locally 663*4882a593Smuzhiyun for files which are not oplocked instead of denying leases 664*4882a593Smuzhiyun in that case. (EXPERIMENTAL) 665*4882a593Smuzhiyun sec 666*4882a593Smuzhiyun Security mode. Allowed values are: 667*4882a593Smuzhiyun 668*4882a593Smuzhiyun none 669*4882a593Smuzhiyun attempt to connection as a null user (no name) 670*4882a593Smuzhiyun krb5 671*4882a593Smuzhiyun Use Kerberos version 5 authentication 672*4882a593Smuzhiyun krb5i 673*4882a593Smuzhiyun Use Kerberos authentication and packet signing 674*4882a593Smuzhiyun ntlm 675*4882a593Smuzhiyun Use NTLM password hashing (default) 676*4882a593Smuzhiyun ntlmi 677*4882a593Smuzhiyun Use NTLM password hashing with signing (if 678*4882a593Smuzhiyun /proc/fs/cifs/PacketSigningEnabled on or if 679*4882a593Smuzhiyun server requires signing also can be the default) 680*4882a593Smuzhiyun ntlmv2 681*4882a593Smuzhiyun Use NTLMv2 password hashing 682*4882a593Smuzhiyun ntlmv2i 683*4882a593Smuzhiyun Use NTLMv2 password hashing with packet signing 684*4882a593Smuzhiyun lanman 685*4882a593Smuzhiyun (if configured in kernel config) use older 686*4882a593Smuzhiyun lanman hash 687*4882a593Smuzhiyun hard 688*4882a593Smuzhiyun Retry file operations if server is not responding 689*4882a593Smuzhiyun soft 690*4882a593Smuzhiyun Limit retries to unresponsive servers (usually only 691*4882a593Smuzhiyun one retry) before returning an error. (default) 692*4882a593Smuzhiyun 693*4882a593SmuzhiyunThe mount.cifs mount helper also accepts a few mount options before -o 694*4882a593Smuzhiyunincluding: 695*4882a593Smuzhiyun 696*4882a593Smuzhiyun=============== =============================================================== 697*4882a593Smuzhiyun -S take password from stdin (equivalent to setting the environment 698*4882a593Smuzhiyun variable ``PASSWD_FD=0`` 699*4882a593Smuzhiyun -V print mount.cifs version 700*4882a593Smuzhiyun -? display simple usage information 701*4882a593Smuzhiyun=============== =============================================================== 702*4882a593Smuzhiyun 703*4882a593SmuzhiyunWith most 2.6 kernel versions of modutils, the version of the cifs kernel 704*4882a593Smuzhiyunmodule can be displayed via modinfo. 705*4882a593Smuzhiyun 706*4882a593SmuzhiyunMisc /proc/fs/cifs Flags and Debug Info 707*4882a593Smuzhiyun======================================= 708*4882a593Smuzhiyun 709*4882a593SmuzhiyunInformational pseudo-files: 710*4882a593Smuzhiyun 711*4882a593Smuzhiyun======================= ======================================================= 712*4882a593SmuzhiyunDebugData Displays information about active CIFS sessions and 713*4882a593Smuzhiyun shares, features enabled as well as the cifs.ko 714*4882a593Smuzhiyun version. 715*4882a593SmuzhiyunStats Lists summary resource usage information as well as per 716*4882a593Smuzhiyun share statistics. 717*4882a593Smuzhiyun======================= ======================================================= 718*4882a593Smuzhiyun 719*4882a593SmuzhiyunConfiguration pseudo-files: 720*4882a593Smuzhiyun 721*4882a593Smuzhiyun======================= ======================================================= 722*4882a593SmuzhiyunSecurityFlags Flags which control security negotiation and 723*4882a593Smuzhiyun also packet signing. Authentication (may/must) 724*4882a593Smuzhiyun flags (e.g. for NTLM and/or NTLMv2) may be combined with 725*4882a593Smuzhiyun the signing flags. Specifying two different password 726*4882a593Smuzhiyun hashing mechanisms (as "must use") on the other hand 727*4882a593Smuzhiyun does not make much sense. Default flags are:: 728*4882a593Smuzhiyun 729*4882a593Smuzhiyun 0x07007 730*4882a593Smuzhiyun 731*4882a593Smuzhiyun (NTLM, NTLMv2 and packet signing allowed). The maximum 732*4882a593Smuzhiyun allowable flags if you want to allow mounts to servers 733*4882a593Smuzhiyun using weaker password hashes is 0x37037 (lanman, 734*4882a593Smuzhiyun plaintext, ntlm, ntlmv2, signing allowed). Some 735*4882a593Smuzhiyun SecurityFlags require the corresponding menuconfig 736*4882a593Smuzhiyun options to be enabled (lanman and plaintext require 737*4882a593Smuzhiyun CONFIG_CIFS_WEAK_PW_HASH for example). Enabling 738*4882a593Smuzhiyun plaintext authentication currently requires also 739*4882a593Smuzhiyun enabling lanman authentication in the security flags 740*4882a593Smuzhiyun because the cifs module only supports sending 741*4882a593Smuzhiyun laintext passwords using the older lanman dialect 742*4882a593Smuzhiyun form of the session setup SMB. (e.g. for authentication 743*4882a593Smuzhiyun using plain text passwords, set the SecurityFlags 744*4882a593Smuzhiyun to 0x30030):: 745*4882a593Smuzhiyun 746*4882a593Smuzhiyun may use packet signing 0x00001 747*4882a593Smuzhiyun must use packet signing 0x01001 748*4882a593Smuzhiyun may use NTLM (most common password hash) 0x00002 749*4882a593Smuzhiyun must use NTLM 0x02002 750*4882a593Smuzhiyun may use NTLMv2 0x00004 751*4882a593Smuzhiyun must use NTLMv2 0x04004 752*4882a593Smuzhiyun may use Kerberos security 0x00008 753*4882a593Smuzhiyun must use Kerberos 0x08008 754*4882a593Smuzhiyun may use lanman (weak) password hash 0x00010 755*4882a593Smuzhiyun must use lanman password hash 0x10010 756*4882a593Smuzhiyun may use plaintext passwords 0x00020 757*4882a593Smuzhiyun must use plaintext passwords 0x20020 758*4882a593Smuzhiyun (reserved for future packet encryption) 0x00040 759*4882a593Smuzhiyun 760*4882a593SmuzhiyuncifsFYI If set to non-zero value, additional debug information 761*4882a593Smuzhiyun will be logged to the system error log. This field 762*4882a593Smuzhiyun contains three flags controlling different classes of 763*4882a593Smuzhiyun debugging entries. The maximum value it can be set 764*4882a593Smuzhiyun to is 7 which enables all debugging points (default 0). 765*4882a593Smuzhiyun Some debugging statements are not compiled into the 766*4882a593Smuzhiyun cifs kernel unless CONFIG_CIFS_DEBUG2 is enabled in the 767*4882a593Smuzhiyun kernel configuration. cifsFYI may be set to one or 768*4882a593Smuzhiyun nore of the following flags (7 sets them all):: 769*4882a593Smuzhiyun 770*4882a593Smuzhiyun +-----------------------------------------------+------+ 771*4882a593Smuzhiyun | log cifs informational messages | 0x01 | 772*4882a593Smuzhiyun +-----------------------------------------------+------+ 773*4882a593Smuzhiyun | log return codes from cifs entry points | 0x02 | 774*4882a593Smuzhiyun +-----------------------------------------------+------+ 775*4882a593Smuzhiyun | log slow responses | 0x04 | 776*4882a593Smuzhiyun | (ie which take longer than 1 second) | | 777*4882a593Smuzhiyun | | | 778*4882a593Smuzhiyun | CONFIG_CIFS_STATS2 must be enabled in .config | | 779*4882a593Smuzhiyun +-----------------------------------------------+------+ 780*4882a593Smuzhiyun 781*4882a593SmuzhiyuntraceSMB If set to one, debug information is logged to the 782*4882a593Smuzhiyun system error log with the start of smb requests 783*4882a593Smuzhiyun and responses (default 0) 784*4882a593SmuzhiyunLookupCacheEnable If set to one, inode information is kept cached 785*4882a593Smuzhiyun for one second improving performance of lookups 786*4882a593Smuzhiyun (default 1) 787*4882a593SmuzhiyunLinuxExtensionsEnabled If set to one then the client will attempt to 788*4882a593Smuzhiyun use the CIFS "UNIX" extensions which are optional 789*4882a593Smuzhiyun protocol enhancements that allow CIFS servers 790*4882a593Smuzhiyun to return accurate UID/GID information as well 791*4882a593Smuzhiyun as support symbolic links. If you use servers 792*4882a593Smuzhiyun such as Samba that support the CIFS Unix 793*4882a593Smuzhiyun extensions but do not want to use symbolic link 794*4882a593Smuzhiyun support and want to map the uid and gid fields 795*4882a593Smuzhiyun to values supplied at mount (rather than the 796*4882a593Smuzhiyun actual values, then set this to zero. (default 1) 797*4882a593Smuzhiyun======================= ======================================================= 798*4882a593Smuzhiyun 799*4882a593SmuzhiyunThese experimental features and tracing can be enabled by changing flags in 800*4882a593Smuzhiyun/proc/fs/cifs (after the cifs module has been installed or built into the 801*4882a593Smuzhiyunkernel, e.g. insmod cifs). To enable a feature set it to 1 e.g. to enable 802*4882a593Smuzhiyuntracing to the kernel message log type:: 803*4882a593Smuzhiyun 804*4882a593Smuzhiyun echo 7 > /proc/fs/cifs/cifsFYI 805*4882a593Smuzhiyun 806*4882a593SmuzhiyuncifsFYI functions as a bit mask. Setting it to 1 enables additional kernel 807*4882a593Smuzhiyunlogging of various informational messages. 2 enables logging of non-zero 808*4882a593SmuzhiyunSMB return codes while 4 enables logging of requests that take longer 809*4882a593Smuzhiyunthan one second to complete (except for byte range lock requests). 810*4882a593SmuzhiyunSetting it to 4 requires CONFIG_CIFS_STATS2 to be set in kernel configuration 811*4882a593Smuzhiyun(.config). Setting it to seven enables all three. Finally, tracing 812*4882a593Smuzhiyunthe start of smb requests and responses can be enabled via:: 813*4882a593Smuzhiyun 814*4882a593Smuzhiyun echo 1 > /proc/fs/cifs/traceSMB 815*4882a593Smuzhiyun 816*4882a593SmuzhiyunPer share (per client mount) statistics are available in /proc/fs/cifs/Stats. 817*4882a593SmuzhiyunAdditional information is available if CONFIG_CIFS_STATS2 is enabled in the 818*4882a593Smuzhiyunkernel configuration (.config). The statistics returned include counters which 819*4882a593Smuzhiyunrepresent the number of attempted and failed (ie non-zero return code from the 820*4882a593Smuzhiyunserver) SMB3 (or cifs) requests grouped by request type (read, write, close etc.). 821*4882a593SmuzhiyunAlso recorded is the total bytes read and bytes written to the server for 822*4882a593Smuzhiyunthat share. Note that due to client caching effects this can be less than the 823*4882a593Smuzhiyunnumber of bytes read and written by the application running on the client. 824*4882a593SmuzhiyunStatistics can be reset to zero by ``echo 0 > /proc/fs/cifs/Stats`` which may be 825*4882a593Smuzhiyunuseful if comparing performance of two different scenarios. 826*4882a593Smuzhiyun 827*4882a593SmuzhiyunAlso note that ``cat /proc/fs/cifs/DebugData`` will display information about 828*4882a593Smuzhiyunthe active sessions and the shares that are mounted. 829*4882a593Smuzhiyun 830*4882a593SmuzhiyunEnabling Kerberos (extended security) works but requires version 1.2 or later 831*4882a593Smuzhiyunof the helper program cifs.upcall to be present and to be configured in the 832*4882a593Smuzhiyun/etc/request-key.conf file. The cifs.upcall helper program is from the Samba 833*4882a593Smuzhiyunproject(https://www.samba.org). NTLM and NTLMv2 and LANMAN support do not 834*4882a593Smuzhiyunrequire this helper. Note that NTLMv2 security (which does not require the 835*4882a593Smuzhiyuncifs.upcall helper program), instead of using Kerberos, is sufficient for 836*4882a593Smuzhiyunsome use cases. 837*4882a593Smuzhiyun 838*4882a593SmuzhiyunDFS support allows transparent redirection to shares in an MS-DFS name space. 839*4882a593SmuzhiyunIn addition, DFS support for target shares which are specified as UNC 840*4882a593Smuzhiyunnames which begin with host names (rather than IP addresses) requires 841*4882a593Smuzhiyuna user space helper (such as cifs.upcall) to be present in order to 842*4882a593Smuzhiyuntranslate host names to ip address, and the user space helper must also 843*4882a593Smuzhiyunbe configured in the file /etc/request-key.conf. Samba, Windows servers and 844*4882a593Smuzhiyunmany NAS appliances support DFS as a way of constructing a global name 845*4882a593Smuzhiyunspace to ease network configuration and improve reliability. 846*4882a593Smuzhiyun 847*4882a593SmuzhiyunTo use cifs Kerberos and DFS support, the Linux keyutils package should be 848*4882a593Smuzhiyuninstalled and something like the following lines should be added to the 849*4882a593Smuzhiyun/etc/request-key.conf file:: 850*4882a593Smuzhiyun 851*4882a593Smuzhiyun create cifs.spnego * * /usr/local/sbin/cifs.upcall %k 852*4882a593Smuzhiyun create dns_resolver * * /usr/local/sbin/cifs.upcall %k 853*4882a593Smuzhiyun 854*4882a593SmuzhiyunCIFS kernel module parameters 855*4882a593Smuzhiyun============================= 856*4882a593SmuzhiyunThese module parameters can be specified or modified either during the time of 857*4882a593Smuzhiyunmodule loading or during the runtime by using the interface:: 858*4882a593Smuzhiyun 859*4882a593Smuzhiyun /proc/module/cifs/parameters/<param> 860*4882a593Smuzhiyun 861*4882a593Smuzhiyuni.e.:: 862*4882a593Smuzhiyun 863*4882a593Smuzhiyun echo "value" > /sys/module/cifs/parameters/<param> 864*4882a593Smuzhiyun 865*4882a593Smuzhiyun================= ========================================================== 866*4882a593Smuzhiyun1. enable_oplocks Enable or disable oplocks. Oplocks are enabled by default. 867*4882a593Smuzhiyun [Y/y/1]. To disable use any of [N/n/0]. 868*4882a593Smuzhiyun================= ========================================================== 869