Mount Samba share using fstab
To mount a Samba share when Linux system comes up after reboot edit the /etc/fstab file and put entry as follows for your Windows/Samba share:
//ntserver/share /mnt/samba smbfs username=username,password=password 0 0
For example, if you want to mount a share called //ntserver/docs then you need to write following entry in /etc/fstab file:
//192.168.0.1/share /mnt/samba smbfs username=nikesh,password=passwd123 0 0








It’s usually not a good idea to put username/passwd in the fstab file. You can modify this by removing the section “username=username,password=password” and replacing it with “credentials=/root/.fstabcredentials” – sans the quotes of course.
Then create the file /root/.fstabcredentials and enter the two lines:
username=ntserver_username
password=ntserver_password
save the file and exit. Change the permissions of the file:
chmod 600 /root/.fstabcredentials
This ensures that only root can access the file.