Fairly new to unix so be gentle :-)
I am having some problems with credential files when manually on the command line I have no problems getting to the window share I need. So to begin this is what is working:
Code:
sudo mount -v //jaws3-pc/D$ ~/mounts/jaws/D -o user="jaws 3",password=password
That works fine but I wanted a bit of extra security and so made a credential file and that's where the strange behaviour begins.
Firstly here is the credential file I started with:
credfile:
Code:
user="jaws 3"
password=password
and so when typing :
sudo mount -v //jaws3-pc/D$ ~/mounts/jaws/D -o credentials=/etc/jaws3-cred
I get:
Code:
,pass=********nel mount options: ip=192.168.1.2,unc=\\jaws3-pc\D$,user="jaws 3"
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I noticed the output starts in a strange way - ",pass=********nel ". But it picks up the username ok and it's reading the cred file ok.
The username does have a space in it so I needed to make sure the credential file wasn't confusing the quotes. removing them doesn't help.
credfile:
Code:
user=jaws 3
password=password
Same output but the quotes are gone:
Code:
,pass=********nel mount options: ip=192.168.1.2,unc=\\jaws3-pc\D$,user=jaws 3
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
I'm still bothered by that strange output with the password at the beginning and extra spurious chars on the end.
Experiement - reverse the data:
credfile:
Code:
password=password
user="jaws 3"
same line:
"sudo mount -v //jaws3-pc/D$ ~/mounts/jaws/D -o credentials=/etc/jaws3-cred"
Code:
mount.cifs kernel mount options: ip=192.168.1.2,unc=\\jaws3-pc\D$,user="jaws 3",pass=********
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Still an error but now the password is in the right place - very strange.
Ok So this is the only thing I found that works:
credfile:
or credfile
Code:
user="jaws 3"
password=password
invoked by:
Code:
sudo mount -v //jaws3-pc/D$ ~/mounts/jaws/D -o credentials=/etc/jaws3-cred,user="jaws 3"
So I am adding the username after the credfile and it works. The credfile itself can still have the username or just the password.
This just confuses the heck out of me and I have no idea what the problem is or why this behaviour occurs.
In reality I guess I've still got my security as the password is hidden and I've applied the correct permissions to the credential file, but I'd at least like to understand what the problem is and how to solve it.
Any ideas from the gurus out there?
Note: I'm actually doing this on a Raspberry pi 2 with the latest raspbian. cifs-utils are already installed. Many tutorials for the said device and o/s state that the credential method should work so I have no real reason to believe there is something odd about the distro / cifs installed.
Also whilst I was searching around I came across someone who appears to have a very similar problem but his solution did not work for me:
https://mattgumbley.wordpress.com/20...res-as-a-user/