Sunday, October 20, 2019

How to Mount a SMB Share in Ubuntu


https://wiki.ubuntu.com/MountWindowsSharesPermanently

https://tecadmin.net/mounting-samba-share-on-ubuntu/


windows IP Address: 192.168.1.7
windows user: user1
windows user password: Pa$$wd
windows share name: winshare
Ubuntu mount point: shared


Step 1: In Windows, create shared a Drive with share name for example "winshare"

Step 2: In Ubuntu, Install the CIFS Utils pkg
sudo apt -y install cifs-utils

Step 3: Create a mount point
sudo mkdir /mnt/shared

Step 4: Mount the volume, You will be prompted for windows user password
sudo mount -t cifs -o user=user1 //192.168.1.7/winshare /mnt/shared

Step 5: Mounting at boot, add to /etc/fstab file, create credentials file:
sudo vi /home/user1/.smbcredentials
username=user1
password=Pa$$wd

sudo vi /etc/fstab
//192.168.1.7/winshare /mnt/shared cifs credentials=/home/user1/.smbcredentials,users,rw,iocharset=utf8 0 0

, mount all /etc/fstab entries
sudo mount -a

, verify sharing work
ls -lh /mnt/shared

No comments:

Post a Comment