LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   centos 5 machine plagued with 'mount error 13 = Permission denied' (https://www.linuxquestions.org/questions/linux-software-2/centos-5-machine-plagued-with-mount-error-13-%3D-permission-denied-4175536571/)

tonj 03-12-2015 05:16 PM

centos 5 machine plagued with 'mount error 13 = Permission denied'
 
I have a centos 5.10 machine (A) 64bit that is trying to mount a shared folder on another centos 5.9 machine (B) 32bit
The command I'm using on machine-A is:
Code:

#  mount -t cifs -o username=<my-user>,password=<my-password> //ip-machine-B/share /media/machine-B
This above command works perfectly on a centos 6 machine on the same lan. It connects to machine B and mounts the shared folder no problem. However the exact same command on the centos 5 (A) machine always gives:
Quote:

mount error 13 = Permission denied
I've watched the mount attempt in wireshark on machine-B and it throws:
Code:

SMB Tree Connect AndX Response, Error: STATUS_WRONG_PASSWORD
but the password I'm using is correct. I figure somehow machine-A just isn't sending the password properly or isn't sending the password at all. I've also tried using a credentials file in the mount command but I still get the permission denied error.
I know the problem must be with machine-A but how do I fix this?

kbp 03-12-2015 09:21 PM

Any characters in the password that might be interpreted by the shell as special? ('$' for example)

Can you try wrapping the username+password section of the command in single quotes?

tonj 03-13-2015 05:17 AM

thanks for your response, there are no special characters in the password.
since my last post I rebooted machine-A, the mount command still doesn't work but this time I'm getting:
Quote:

mount: block device //machine-B/share is write-protected, mounting read-only
mount: cannot mount block device //machine-B/share read-only
I've tried putting both single and double quotes around the username+password section of the command like you said but it made no difference.

kbp 03-13-2015 11:10 PM

If you leave 'password=...' out of the arguments you should get prompted for it, could you give that a try?

tonj 03-14-2015 04:14 AM

yes thanks I tried that, it did prompt for the password but still get the same error:
Quote:

mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
this is baffling because other computers on my lan can connect to the 'share' just fine using the same username and password. I have a windows 7 machine and two centos 6 machines and both can mount the share first time every time. I can only conclude that machine-A (centos 5 64 bit) is missing something but I don't know what it is.

kbp 03-14-2015 04:55 PM

There's nothing mounted on /media/machine-B already is there?

tonj 03-14-2015 05:06 PM

no, this is the only mount being tried on machine-B from machine-A

kbp 03-14-2015 06:01 PM

Can you try adding 'sec=ntlmssp' to the mount options?

tonj 03-15-2015 04:36 AM

thankyou yes I'be tried both sec=ntlmssp and sec=ntlm but I still get the error:
Quote:

mount: block device //machine-B/share is write-protected, mounting read-only
mount: cannot mount block device //machine-B/share read-only

kbp 03-15-2015 05:09 AM

If you try a mount with verbose ('-v') it may give some more detail

Also have you tried specifying the domain?

tonj 03-15-2015 04:33 PM

using the -v flag gives exactly the same output as above.
I'm a bit foggy regarding the domain. The share is on my lan so how would I do that?

kbp 03-15-2015 04:44 PM

The RHEL system sharing the directory would be running samba, if you read https://access.redhat.com/documentat...nfiguring.html you should be able to determine the servers settings for authentication.

tonj 03-15-2015 05:00 PM

thankyou for that link. After reading some docs I installed samba-client.x86_64 and tried with:
Quote:

# smbclient //<hostname>/<sharename> -U <username>
and it gave:
Quote:

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33-3.40.el5_10]
Server not using user level security and no password supplied.
smb: \>
that's weird because other machines on the lan have no problem seeing user level security and password.
I also tried
Quote:

mount -v -t cifs -o dom=WORKGROUP,sec=ntlmssp,username=<user>,password=<password> //machine-B/share /media/<machine-B-share
and it gave:
Quote:

mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
it's confusing, one minute the error is cannot mount block device //machine-B/share read-only and the next it's Permission denied
one problem with the docs is they're all gui demo's, however my machines at both ends are console only.

kbp 03-15-2015 05:48 PM

Anything interesting in the logs on the server side after a mount attempt? Could you please check that cifs module is present on the RHEL 5 client (lsmod | grep cifs)?

tonj 03-18-2015 03:44 PM

yes in /var/log/samba/log.<ip-machine-A> there were lots of lines like this:
Quote:

[2015/03/16 15:42:00, 0] smbd/sesssetup.c:reply_sesssetup_and_X(1263)
reply_sesssetup_and_X: Rejecting attempt at SPNEGO session setup when it was not negoitiated.
which makes me suspicious that machine-B is not giving the password, or not completing it's side of the negotiating process.


All times are GMT -5. The time now is 08:42 PM.