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

I'm having some trouble mounting a network share using autofs. I have added the following line to /etc/auto.master:

/mnt/mountpoint       /etc/auto.servername

I then created the file /etc/auto.servername with the following contents:

server-ip -fstype=cifs,rw,noperm,user=DOMAIN\username,pass=password ://server-ip/share

I then run service autofs restart and ls /mnt/mountpoint to determine whether autofs succeeds in mounting the share (it does not.) The result from dmesg is:

CIFS VFS: Send error in SessSetup = -13
CIFS VFS: cifs_mount failed w/ return code = -13
Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE

However, if I simply run mount -t cifs //server-ip/share /mnt/mountpoint -o user=username and enter the password on prompt, the share is mounted without any problems. I have verified the correct password is /etc/auto.servername.

Any ideas what I'm doing wrong? Thanks!

share|improve this question

2 Answers 2

change

server-ip -fstype=cifs,rw,noperm,user=DOMAIN\username,pass=password ://server-ip/share

to

share -fstype=cifs,rw,noperm,user=username,pass=password,domain=domain ://server-ip/share

share|improve this answer
    
That's what's done it for me. mount was not appreciating the domain\user backslash. Using the domain as another parameter worked just fine –  JSancho Mar 31 '13 at 10:18

I would guess that maybe you aren't escaping your credentials correctly in the file. The \ in the username may be breaking things. I use a credentials file, I believe it is much safer.

This are the files I use to auto-mount a particular share.

/etc/auto.master

/.autofs/cifssrvername /etc/auto.cifssrvername --timeout=600

/etc/auto.cifssrvername

share   -fstype=cifs,credentials=/etc/samba/.smbauth/smb.authfile.cifssrvername,uid=0,gid=0,file_mode=0664,dir_mode=0775 ://cifssrvername/share

I store my credentials in a separate file so I can set better permissions (0400).

/etc/samba/.smbauth/smb.authfile.cifssrvername

username=domain\user
password=...

The filesystem is then visible in /.autofs/cifssrvername/share.

share|improve this answer
    
I am using method 3 of the CentOS wiki at centos.org/modules/newbb/viewtopic.php?topic_id=12716 , which says that "/etc/auto.mymount can be made world-unreadable, so, use of the credentials file is not as important." I have also tried using just the username without DOMAIN\, with the same result, so I don't believe that is the cause. However, I will try your settings soon (and accept the answer if it works.) –  robjb Apr 20 '11 at 1:22
    
This didn't solve my issues, although it seems that auto.master isn't being used (I now believe the CIFS VFS errors were from previous failed attempts using fstab.) However, I was able to get it working with /etc/fstab and a separate credentials file. –  robjb Apr 21 '11 at 18:49

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.