- 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

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

Now create a new file: /etc/accessfile with following contents
username=nikesh
password=some_password
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 (e.g.man mount.cifs)


source:http://linuxpoison.blogspot.com/2010/05/135781677518318.html