I'm having trouble mounting a share on my XenServer (5.6 FP1). From the command line I try:
mount.cifs //server/share /mnt/share -o credentials=credfile
The contents of credfile is:
username=Administrator
password=What@zR\!p3s
When I run the above mount command I get "Access Denied". However if I run the following command it works:
mount.cifs //server/share /mnt/share -o username=Administrator,password=What@zR\!p3s
Please note the "\" is to escape the bang and I've tried this with and without it in the credentials file. Any suggestions?
I have the same problem because my password contain comma symbol (i.e. "PASS,WORD"):
At first, you should try enable verbose mode (--verbose option):
Here I see my problem. Comma breaks all stuff. Solution is use credential file. What is written in man mount.cifs:
Create this file any way you like:
and use (--verbose can be omitted)
No problem with password.
A common issue with old versions of mount.cifs was that the newline at the end of the file was kept as part of the password.
So you shouldn't need to escape, and should try to rewrite this file without a trailing newline.
To do so in vim, use
:set noeol binary
before saving. You can check that there is no trailing newline withxxd credfile
, and confirm that it does not finish with0a
.If this doesn't work, I'll have to check your exact codebase. Which package (distribution, version and release) or source (archive name) are you using for
cifs-utils
?Have you tried removing the slash? completely? I don't believe the credentials file should need to be escaped at all. It needs to be escaped on the shell because the shell is interpreting the characters, not the mount.cifs command.
Another thing to try is to type the special character twice... I had a password with a $ in it, and had to replace it with $$. However, I'm currently having issues with the carrot: '^'
For mount.cifs version 4.5 the following worked for me: credentials in order of domain, username, password, no newline after the password, no escaping of special characters or quotes.
This was very helpful! My problem was an extra space in the "credential" file that the
--verbose
showed meDid a "vi" on the credentials file and
:set list
Saw the extra trailing blank. Removed it. Tried again. Note the "blank" is now gone.Try quoting it.
I.e.,
And I hope that's not really your password. If it is, you now need to change it.