Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Mount And Unmount Cifs And Nfs Network File Systems ====== **General Information** Working with network shared file systems. ---- ===== Example Data ===== The examples below assume the following server/share information: * File server IP: 192.168.1.100 * Samba Username: rjones * Samba Password: 123456 * Samba Share Name: public-docs * NFS Share Name: public-storage ---- ===== CIFS ===== Mounting a Common Internet File System (CIFS) share. **Ensure packages are installed** <code bash> yum install -y cifs-utils samba-client </code> * samba-client optional for viewing shares. \\ **Create target mount point, list shares** <code bash> mkdir /mnt/cifs-share smbclient -L 192.168.1.100 </code> \\ **Temporarily Mount Share** <code bash> mount -t cifs -o username=rjones //192.168.1.100/public-docs /mnt/cifs-share </code> \\ **Persistent Mount Share: Edit /etc/fstab, Add Entry/Save** <code bash> vim /etc/fstab //192.168.1.100/public-docs /mnt/cifs-share cifs username=rjones,password=123456 0 0 </code> \\ **More Secure Alternative: CIFS with credentials file** <code bash> vim /etc/fstab //192.168.1.100/public-docs /mnt/cifs-share cifs credentials=/root/.cifs_mount 0 0 </code> * /root/.cifs_mount file contents<code text>username=rjones password=123456</code> * File should be chmod 600 and owned by root due to security concerns of a username/password being in a text file. \\ **Mount all and Verify** <code bash> mount -a df -hT </code> ---- ===== NFS ===== Mounting a Network File System (NFS) share. **Ensure packages are installed** <code bash> yum install nfs-utils </code> \\ **Create target mount point** <code bash> mkdir /mnt/nfs-share </code> \\ **Temporarily Mount Share** <code bash> mount -t nfs 192.168.1.100:/public-storage /mnt/nfs-share </code> \\ **Persistent Mount Share: Edit /etc/fstab, Add Entry/Save** <code bash> vim /etc/fstab 192.168.1.100:/public-storage /mnt/nfs-share nfs defaults 0 0 </code> \\ **Mount all and Verify** <code bash> mount -a df -hT </code> ---- linux_wiki/mount_and_unmount_cifs_and_nfs_network_file_systems.txt Last modified: 2019/05/25 23:50(external edit)