Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have one server that is mounting with fstab using a credentials file. The credentials file (.Smbcredentials) code is :

username=my_windows_login
password=my_password
domain=my_domain

My code in fstab is:

//myshare/myfolder /mnt/backup cifs credentials=/home/mydirectory/.Smbcredentials

This works perfectly. However, when trying to duplicate this on another server (same version) I get

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

I'm running as root, all the folder permissions are identical.....everything is identical. Yet I get error 13 on the new server only. What could be wrong?

share|improve this question
    
have you checked /var/log/ for anything that may hint at what's wrong? –  SnakeDoc Jan 24 at 1:52

2 Answers 2

From the Ubuntu wiki page, try adding a few of the missing params and make sure your cred file is 600: https://wiki.ubuntu.com/MountWindowsSharesPermanently

chmod 600 ~/.Smbcredentials

fstab line:

//myshare/myfolder /mnt/backup cifs credentials=/home/mydirectory/.Smbcredentials,iocharset=utf8,sec=ntlm 0 0 

EDIT:

Have you tried outside of fstab to get this mounted? Maybe using the mount command would give you some more usable output

mount -t cifs -o username=USERNAME,password=PASSWD //myshare/myfolder /mnt/backup
share|improve this answer
    
I have ensured that the file is chmod 600 and added the parameters, but I still get error 13. –  Pickle Jan 23 at 19:48
    
added something to try –  shtuff.it Jan 23 at 20:04
    
Oddly enough, mounting outside of fstab works. –  Pickle Jan 23 at 20:10

Tried using sudo to mount?

I was under the impression that /mnt/ was not writable by regular users.

ie: sudo mount /mnt/backup

Also, make sure that your fstab entry includes 0 0 at the end.

share|improve this answer
    
you are correct that normal users cannot just mount devices. however i think he is trying this in fstab which should be used under the root account at boot. –  SnakeDoc Jan 24 at 1:54
    
Correct, I am doing this under root. I have also tried adding 00 to the fstab but it did not fix it. –  Pickle Jan 24 at 14:06
    
the space in between the zeros is very important, btw. –  Justin Jan 25 at 0:27
    
I assume that there is a reason why you don't want your plaintext password in the fstab file. if not, you can replace credentials=/home/mydirectory/.Smbcredentials with username=user,password=password,domain=domain –  Justin Jan 25 at 0:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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