I can use the following command to log into a samba share on my network:

smbclient -L //host.name.com -U myUser --workgroup=WORK

where myUser is my username and WORK is the name of the workgroup. I can also access this share via Places->Connect to Network without issues.

However, I can't mount the drive permanently. Here's what I did after following the Ubuntu instructions on mounting a sambda share permanently:

I have created a file called ~/.smbcredentials and run chmod 600 ~/.smbcredentials:


(where pass is my password)

I have also added the following line to my /etc/fstab:

//host.name.com/ /media/share cifs credentials=/home/myUser/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

I have also run sudo mkdir /media/share.

However, when I run sudo mount -a I see the following:

mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

What am I doing wrong?

  • What are permission of /media/share directory. Try chmod 777 just to troubleshoot – FreeSoftwareServers Aug 7 '15 at 6:27
  • I ran sudo chmod 777 /media/share, same result. – quant Aug 17 '15 at 6:25
  • I tried chmod 777 ~/.smbcredentials as well. – quant Aug 17 '15 at 6:27

Change your ~/.smbcredentials


That's all ;)

The problem occurs when you use the user name and the domain name together.

And please revert the changes for ~/.smbcredentials

chmod o-rwx,-x ~/.smbcredentials
  • Nice one. Could you explain how you found this information? – quant Aug 18 '15 at 7:16
  • 1
    I have used my working configuration and changed according to your specifications. Since I was sure my configuration works, the following was simple. – A.B. Aug 18 '15 at 7:18
  • Ok good enough for me :) I'll award the bounty once I'm allowed. – quant Aug 18 '15 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.