Mount cifs using a credentials file

cifsmountusers

I am trying to mount a folder from my embedded Linux system to a windows 7 computer. I keep getting Permission Denied when I try using a credentials file.
When I do it from command line as root it works. I type in

mount -t cifs //[IPAddress]/[Folder Path] /home/[user]/ShareFolder -o username=[Username] -o uid=[user]

when I do it from the fstab folder it works.

//[IPAdress]/[Folder Path] /home/[user]/ShareFolder cifs user,username=[Username],password=[Password],sec=ntlm,uid=[user],noauto 0 0

but if I switch to using a credentials file it does not work

//[IPAddress]/[Folder Path] /home/[user]/ShareFolder cifs user,credentials=/home/[user]/smbcredentials,user,sec=ntlm,uid=[user],noauto 0 0

the credentials file is

username=[username]

password=[password]

I have tried it with domain, and that didn't work. I turned on verbose to see what the difference was between the working fstab and the non-working fstab with credentials file.

working:

mount.cifs kernel mount options: ip=[IPAddress],unc=\[IPAddress]…, sec=ntlm,noauto,uid=500,gid=500,user=[WINDOWS USERNAME],prefixpath=[path to folder],pass=*

non-working:

mount.cifs kernel mount options: ip=[IPAddress],unc=\[IPAddress]…, sec=ntlm,noauto,uid=500,gid=500,user=[LINUX USERNAME],prefixpath=[path to folder],pass=*

the difference is that the working one uses the windows username as user and the non-working one uses the linux username. I'm not sure how to fix this.

Best Answer

I had a similar issue. For me installing cifs-utils fixed the issue.

Related Question