📄 readme
字号:
The CIFS VFS support for Linux supports many advanced network filesystem features such as heirarchical dfs like namespace, hardlinks, locking and more. It was designed to comply with the SNIA CIFS Technical Reference (which supersedes the 1992 X/Open SMB Standard) as well as to perform best practice practical interoperability with Windows 2000, Windows XP, Samba and equivalent servers. For questions or bug reports please contact: sfrench@samba.org (sfrench@us.ibm.com) Build instructions:==================For Linux 2.4:1) Get the kernel source (e.g.from http://www.kernel.org)and download the cifs vfs source (see the project pageat http://us1.samba.org/samba/Linux_CIFS_client.html)and change directory into the top of the kernel directorythen patch the kernel (e.g. "patch -p1 < cifs_24.patch") to add the cifs vfs to your kernel configure options ifit has not already been added (e.g. current SuSE and ULusers do not need to apply the cifs_24.patch since the cifs vfs isalready in the kernel configure menu) and thenmkdir linux/fs/cifs and then copy the current cifs vfs files fromthe cifs download to your kernel build directory e.g. cp <cifs_download_dir>/fs/cifs/* to <kernel_download_dir>/fs/cifs 2) make menuconfig (or make xconfig)3) select cifs from within the network filesystem choices4) save and exit5) make dep6) make modules (or "make" if CIFS VFS not to be built as a module)For Linux 2.6:1) Download the kernel (e.g. from http://www.kernel.org or from bitkeeperat bk://linux.bkbits.net/linux-2.5) and change directory into the topof the kernel directory tree (e.g. /usr/src/linux-2.5.73)2) make menuconfig (or make xconfig)3) select cifs from within the network filesystem choices4) save and exit5) makeInstallation instructions:=========================If you have built the CIFS vfs as module (successfully) simplytype "make modules_install" (or if you prefer, manually copy the file tothe modules directory e.g. /lib/modules/2.4.10-4GB/kernel/fs/cifs/cifs.o).If you have built the CIFS vfs into the kernel itself, follow the instructionsfor your distribution on how to install a new kernel (usually youwould simply type "make install").If you do not have the utility mount.cifs (in the Samba 3.0 source tree and on the CIFS VFS web site) copy it to the same directory in which mount.smbfs and similar files reside (usually /sbin). Although the helper software is not required, mount.cifs is recommended. Eventually the Samba 3.0 utility program "net" may also be helpful since it may someday provide easier mount syntax forusers who are used to Windows e.g. net use <mount point> <UNC name or cifs URL>Note that running the Winbind pam/nss module (logon service) on all of yourLinux clients is useful in mapping Uids and Gids consistently across thedomain to the proper network user. The mount.cifs mount helper can betrivially built from Samba 3.0 or later source e.g. by executing: gcc samba/source/client/mount.cifs.c -o mount.cifsAllowing User Mounts====================To permit users to mount and unmount over directories they own is possiblewith the cifs vfs. A way to enable such mounting is to mark the mount.cifsutility as suid (e.g. "chmod +s /sbin/mount/cifs). To enable users to umount shares they mount requires1) mount.cifs version 1.4 or later2) an entry for the share in /etc/fstab indicating that a user mayunmount it e.g.//server/usersharename /mnt/username cifs user 0 0Note that when the mount.cifs utility is run suid (allowing user mounts), in order to reduce risks, the "nosuid" mount flag is passed in on mount todisallow execution of an suid program mounted on the remote target.When mount is executed as root, nosuid is not passed in by default,and execution of suid programs on the remote target would be enabledby default. This can be changed, as with nfs and other filesystems, by simply specifying "nosuid" among the mount options. For user mounts though to be able to pass the suid flag to mount requires rebuilding mount.cifs with the following flag: gcc samba/source/client/mount.cifs.c -DCIFS_ALLOW_USR_SUID -o mount.cifsThere is a corresponding manual page for cifs mounting in the Samba 3.0 andlater source tree in docs/manpages/mount.cifs.8 Samba Considerations ==================== To get the maximum benefit from the CIFS VFS, we recommend using a server that supports the SNIA CIFS Unix Extensions standard (e.g. Samba 2.2.5 or later or Samba 3.0) but the CIFS vfs works fine with a wide variety of CIFS servers. Note that uid, gid and file permissions will display default values if you do not have a server that supports the Unix extensions for CIFS (such as Samba 2.2.5 or later). To enable the Unix CIFS Extensions in the Samba server, add the line: unix extensions = yes to your smb.conf file on the server. Note that the following smb.conf settings are also useful (on the Samba server) when the majority of clients are Unix or Linux: case sensitive = yes delete readonly = yes ea support = yesNote that server ea support is required for supporting xattrs from the Linuxcifs client, and that EA support is present in later versions of Samba (e.g. 3.0.6 and later (also EA support works in all versions of Windows, at least toshares on NTFS filesystems). Extended Attribute (xattr) support is an optionalfeature of most Linux filesystems which may require enabling viamake menuconfig Some administrators may want to change Samba's smb.conf "map archive" and "create mask" parameters from the default. Creating special devices (mknod) remotely may require specifying a mkdev function to Samba if you are not using Samba 3.0.6 or later. For more information on these see the manual pages("man smb.conf") on the Samba server system. Note that the cifs vfs,unlike the smbfs vfs, does not read the smb.conf on the client system (the few optional settings are passed in on mount via -o parameters instead). Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to deleteopen files (required for strict POSIX compliance). Windows Servers already supported this feature. Samba server does not allow symlinks that refer to filesoutside of the share, so in Samba versions prior to 3.0.6, most symlinks tofiles with absolute paths (ie beginning with slash) such as: ln -s /mnt/foo barwould be forbidden. Samba 3.0.6 server or later includes the ability to create such symlinks safely by converting unsafe symlinks (ie symlinks to server files that are outside of the share) to a samba specific format on the serverthat is ignored by local server applications and non-cifs clients and that willnot be traversed by the Samba server). This is opaque to the Linux clientapplication using the cifs vfs. Absolute symlinks will work to Samba 3.0.5 orlater, but only for remote clients using the CIFS Unix extensions, and willbe invisbile to Windows clients and typically will not affect localapplications running on the same server as Samba. Use instructions:================Once the CIFS VFS support is built into the kernel or installed as a module (cifs.o), you can use mount syntax like the following to access Samba or Windows servers: mount -t cifs //9.53.216.11/e$ /mnt -o user=myname,pass=mypasswordBefore -o the option -v may be specified to make the mount.cifsmount helper display the mount steps more verbosely. After -o the following commonly used cifs vfs specific optionsare supported: user=<username> pass=<password> domain=<domain name> Other cifs mount options are described below. Use of TCP names (in addition toip addresses) is available if the mount helper (mount.cifs) is installed. Ifyou do not trust the server to which are mounted, or if you do not havecifs signing enabled (and the physical network is insecure), consider useof the standard mount options "noexec" and "nosuid" to reduce the risk of running an altered binary on your local system (downloaded from a hostile serveror altered by a hostile router).Although mounting using format corresponding to the CIFS URL specification isnot possible in mount.cifs yet, it is possible to use an alternate formatfor the server and sharename (which is somewhat similar to NFS style mountsyntax) instead of the more widely used UNC format (i.e. \\server\share): mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswdWhen using the mount helper mount.cifs, passwords may be specified via alternatemechanisms, instead of specifying it after -o using the normal "pass=" syntaxon the command line:1) By including it in a credential file. Specify credentials=filename as oneof the mount options. Credential files contain two lines username=someuser password=your_password2) By specifying the password in the PASSWD environment variable (similarlythe user name can be taken from the USER environment variable).3) By specifying the password in a file by name via PASSWD_FILE4) By specifying the password in a file by file descriptor via PASSWD_FDIf no password is provided, mount.cifs will prompt for password entryRestrictions============Servers must support the NTLM SMB dialect (which is the most recent, supported by Samba and Windows NT version 4, 2000 and XP and many other SMB/CIFS servers) Servers must support either "pure-TCP" (port 445 TCP/IP CIFS connections) or RFC 1001/1002 support for "Netbios-Over-TCP/IP." Neither of these is likely to be a problem as most servers support this. IPv6 support is planned for the future. CIFS VFS Mount Options======================A partial list of the supported mount options follows: user The user name to use when trying to establish the CIFS session. password The user password. If the mount helper is installed, the user will be prompted for password
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -