I want to preface my question saying that I am relatively weak with Linux and the command line and also StackExchange.

I am trying to set-up a network drive from a different unix machine.

I have followed this guide on how to permanently mount a network drive

sudo mount -a

Results in:

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

My fstab looks like:

//[url to server]/[path to my folder to link] [path to local folder to mount] cifs credentials=[path to credentials file],uid=1000,gid=1000,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=ntlm 0 0

The fstab looks little different as given in the guide but only because I used a template from coleagues that had the exact same set-up with the only difference of it working. The credentials file has the same username and password I use to SSH into the machine.

Verbose mount output was not much helpful either:

mount.cifs kernel mount options: ip=[IP],unc=\\[url]\apriede,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=ntlm,uid=1000,gid=1000,user=apriede,prefixpath=projects,pass=********

Most problems I found while searching for an answer had an issue with an unset or wrong sec option, which I know should be correct in my instance because it works for my coleagues, so I hope it validates my question as a new one.

  • @garethTheRed: Is it important? mount -a runs under root anyway. – Incnis Mrsi Sep 14 '15 at 14:22
  • @IncnisMrsi - so it did. I didn't read the question properly :-) – garethTheRed Sep 14 '15 at 15:55

You state that the credentials file contain the same username and password you use to SSH into the machine. This is perhaps not the same.

When you mount a CIFS share, you specify a username that is known to Samba (smbpasswd -a $newuser) and this account also needs a UNIX counterpart account, meaning a Samba user, needs a UNIX account with the same name. The password can be different however.

Check if you can manually mount it, and verify your Samba password with smbpasswd, or change it to something, then mount it.

It could also be selinux, I am not sure, It could spit out a different error. Check if selinux is enabled on the Samba server


If its on Enforcing you can try to disable it temporary;

setenforce 0

And see if it works.

  • Original poster states passwords are the same. You casted a doubt on it, but it’s your subjective opinion, neither answer nor a real solution. Familiarize yourself with Stack Exchange’s guidelines on answers, please. – Incnis Mrsi Sep 14 '15 at 14:16
  • @IncnisMrsi, I also stated I am incompetent :^), so he might very well be right. I got no idea to be honest if the passwords are the same that was just my assumption. I will try to dig into the suggestions of the answer tomorrow and see if brings about any fruit. – apriede Sep 14 '15 at 15:24
  • None of the guides and links I came up with in my search pointed out smbpasswd setup side of things. So this was exactly what I needed. – apriede Sep 15 '15 at 8:18

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.