linux poison RSS
linux poison Email

How to mount samba share on Linux client

Samba can be used to allow connectivity between Linux and Windows. Samba can be used to share printers, share directories, connect to an windows domain, and many other useful features.

In order to mount your samba share to your Linux client open up the /etc/fstab file and insert the following line into this file

// /mnt/samba cifs credentials=/etc/accessfile 0 0

Now create a new file: /etc/accessfile with following contents
Save the above file and restart your Linux client (or type command mount -a), after restart you should now able to access the share content from the samba server under /mnt/samba directory.

This is preferred over having passwords in plaintext in a shared file, such as /etc/fstab. Be sure to protect any credentials file properly and also note that there should not be any extra space in this file.

It there are any space in this credentials file you might get the following error on trying to mount the file system
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page ( mount.cifs)


Post a Comment

Related Posts with Thumbnails