You will note that you have enter the password and username here. This is not advisable since the fstab file is readable by all users. Will fix this in the next step.
4. Not having our password in the fstab file
RUN THIS AS ROOT! Make this file in the home folder of root (by default /root). Why? Because only root can access this folder or privileged users. This makes sure that other people cannot access the credentials file.
So create and open the file /root/.smbcredentials using vim or nano. (Eg sudo vi /root/.smbcredentials)
Save and close and then set the permissions that only root can read it.
sudo chmod 600 /root/.smbcredentials
You can verify it by writing:
sudo ls -al /root/.smbcredentials
If everything is correct you should see this:
Now open up your fstab again and replace the username and password with credentials=/root/.smbcredentials. Your file should look like this: