Microsoft Windows publishes folders for network access using the SMB (Server Message Block) or CIFS (Common Internet File System) protocols (refer to the Microsoft SMB Protocol and CIFS Protocol Overview). Most modern *nix variants include tools to enable access to Windows shared folders.
Windows shares may be accessed in 2 ways:
- Command line, ftp-like command set (smbclient).
- Mounted file system (smbmount or mount.cifs - Linux only).
SMB Server tools
The Samba suite (http://samba.org) provides the ability for *nix systems to act as a Windows server (including domain server) and the ability to publish Windows shares.
The Samba tools are available for most *nix variants. They provide the ability to act as a Windows client using the smbclient CLI tool. This tool is scriptable and provides functionality very similar to the ftp command set.
CIFS tools
Linux systems using version 2.6.x of the Linux kernel have the CIFS virtual file system capability. This allows them to mount Windows shares using the CIFS protocols, and therefore allows direct access to the share from the file system.
Example
Assume that the Windows server Wserver publishes the Data share, and requires the Windows domain user wdomain\datauser
to authenticate with the password datapassword
.
This share can be mounted as /data/wserver
with the following command:
mount -t cifs -o username=wdomain/datauser,password=datapassword,uid=rhapsody //wserver/data /data/wserver
The options used provide authentication to the Windows server (username=wdomain/datauser
and password=datapassword
), and set the ownership on the mount point and the mounted file system to the local rhapsody user. This ensures that the Rhapsody engine has read/write access to the file system and can, therefore, use it with directory communication points.
If the uid
option is not set, the mounted file system will be owned by root.
Automated mounting of the Windows share can be enabled using an /etc/fstab
entry such as:
//wserver/data /data/wserver cifs username=wdomain/datauser,password=datapassword,uid=rhapsody 0 0
Related Topics