I have a few SMB Shares running in my Home which i wanted to access from one of my Ubuntu Desktops. The Share in question was a Software repository on my NAS and so in my instructions you will see software or sw referenced, these you will have to change with your equivalent.
First thing to do is grab the cifs-utils
sudo apt-get install cifs-utils
Next we need to create a Directory on the Ubuntu machine to Mount the Share to. In my case I am creating a Directory called sw in /mnt
sudo mkdir /mnt/sw
Now we need to add this mapping into the fstab
sudo nano fstab
The synatx is as follows:
//servername/sharename /media/windowsshare cifs username=<Username>, password=<password>,iocharset=utf8,sec=ntlm
iocharset=utf8 allows access to files with names in non-English languages.
sec=ntlm allows ntlm authentication which i have on my SMB Shares
At the end of my fstab I entered the following:
//192/168.16.31/software /mnt/sw cifs username=admin,password=password,iocharset=utf8,sec=ntlm
Write out the changes in Nano
Test connectivity by issuing:
sudo mount -a
If this comes back with no errors, the share should mount after each reboot.
There is some good information Here on adding credentials via txt file and securing but as this is my home environment i don’t need that.