Quick Reference
The command below can be used to create a temporary mount point although the mount will disassociate on next server reboot.
mkdir /home/<user>/mnt/DataManagement && \
sudo mount -t cifs //10.10.145.5/DataManagement /home/<user>/mnt/DataManagement -o username=<user>,password="",uid=1000
Persistent Mounts
Create a mount point to a Windows share name (e.g. Q):
sudo mkdir /mnt/share/Q
Append the following similar line to
/etc/fstab
– to associate the mount automatically upon machine boot://192.168.50.19/Transfer /mnt/share/Q cifs credentials=/home/DatamanBU/.smbpasswd,uid=1011,gid=1005,dir_mode=0775,file_mode=0775,rw 0 0
Notes:
uid=1011
: mount as userusername
. Find UID withid -u <username>
gid=1005
: mount as groupdatamgrs
dir_mode=0775
,file_mode=0775
: readable/writeable by any users that are members of datamgrs groupThe credentials file
/home/DatamanBU/.smpbasswd
must already exist (or be created) by root. It contains 2 lines:username=DatamanBU password=password
Make the credentials file only readable by root:
sudo chmod 700 /home/DatamanBU/.smbpasswd
Associate the mount immediately:
sudo mount -a -v -t cifs