Permanently mount a samba share using fstab
Guest account: no password needed
To permanently mount a samba share using fstab:
First, let’s create the mount directory. You will need a separate directory for each mount.
sudo mkdir /media/yourlocalsharenamename
Next backup and then edit your /etc/fstab file (with root privileges):
sudo cp /etc/fstab /etc/fstab.bak
gksudo gedit /etc/fstab
Scroll to the bottom of the file and add this line:
//yourservername/yoursharename /media/yourlocalsharename cifs guest,uid=1000 0 0
- guest indicates you don’t need a password to access the share,
- uid=1000 makes the Linux user specified by the id the owner of the mounted share, allowing them to rename files,
After you add the entry to /etc/fstab save and exit gedit. Then type:
sudo mount -a
This will (re)mount all entries listed in /etc/fstab. Finally check to see that your share was mounted. You also might want to look at /var/log/demesg to make sure there were no errors when you mounted your file.