LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-27-2015, 07:15 AM   #1
louiscar
LQ Newbie
 
Registered: Oct 2015
Posts: 2

Rep: Reputation: Disabled
CIFS window shares "permission denied" when using a credential file


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:
Code:
password=password
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/

Last edited by louiscar; 10-27-2015 at 07:19 AM.
 
Old 10-29-2015, 06:18 PM   #2
louiscar
LQ Newbie
 
Registered: Oct 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
anyone?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cifs "mount error 13 = Permission denied" CIFS SUCKS humbletech99 Linux - Networking 45 04-06-2020 05:31 AM
tshark gives "permission denied" writing to (any) file in home dir. kr0m3 Linux - Networking 6 10-08-2019 06:45 AM
Unable to open configuration file "/etc/samba/smb.conf" Permission denied jijawm Linux - Enterprise 8 08-18-2010 11:47 AM
sendmail: "permission denied" when using include:/file sohmc Linux - Software 1 05-22-2003 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration