I'm running raspbian on an RPi2B and I'm trying to mount a network drive. I've tried the following:

sudo mount -t cifs -o username=admin,password=passwd // /mnt/myshare

But I keep getting permission denied error.

I can access this share fine on my macbook pro with the same credentials so I don't understand what's going on.

I have dashes (-) in my password so I tried enclosing it in quotes, escaping the dashes etc. but nothing worked.

Any help would be appreciated!

  • Have you already tried to use a credential file? Just in case it is a syntax issue? – Bratchley Feb 15 '15 at 0:29
  • Yes I've tried that too – doovers Feb 15 '15 at 2:54


sudo su -
mount -t smbfs -o username=admin,password=passwd // /mnt/myshare

Are you sure to set every permission to root ?

| improve this answer | |
  • That gives me this: unknown filesystem type 'smbfs'. I'm not sure what you mean by 'Are you sure to set every permission to root', can you explain please? – doovers Feb 15 '15 at 21:54
  • I've removed the password from the share and tried with -o guest but still get permission denied – doovers Feb 16 '15 at 11:10
  • When you want to login to root you have to username=root not username=admin – PersianGulf Feb 16 '15 at 14:54
  • Yes when I ssh'd in I used the root account but the share username was admin although I have removed the password protection and I'm still getting permission denied – doovers Feb 16 '15 at 20:53

You basically try to ssh (cifs is an operation comparable to ssh) into the 'root' directory where you need to have the correct permissions for user 'admin'. If 'root' has not at least read permissions set for user 'admin' then user 'admin' cannot ssh into directory 'root' even if the credentials given in the ssh command are correct.

| improve this answer | |
  • I've tried ssh with root but still getting permission denied – doovers Feb 16 '15 at 11:04
  • I also removed password and tried with -o guest but same result. – doovers Feb 16 '15 at 11:11

Well after a painful day or so of trying to figure this out, it turns out I needed to set sec=ntlm and now it works.

| improve this answer | |

Just try:

sudo mount -t cifs //ipaddress/sharedfolername /mountlocation --verbose -o credentials=/credentials/file/location

But creating a file at the credentials file location with the contents:


| improve this answer | |

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.