Samba: mount error(13): Permission denied

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Samba: mount error(13): Permission denied

Post by ^rooker »

[PROBLEM]
Trying to mount a CIFS/Samba share on Debian 8 (Jessie) by an entry in /etc/fstab, I get the following error message:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Regardless which credentials I use.
Of course, I also checked if the credentials are correct - but the "permission denied" persists, regardless of which credentials I use.
With supposedly-correct logins, as well as bogus ones: Same error message.

Checking CIFS messages in dmesg:

Code: Select all

$ dmesg | tail
Gives:
[ 2133.740832] Status code returned 0xc000018d NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE
[ 2133.740839] CIFS VFS: Send error in SessSetup = -13
[ 2133.740957] CIFS VFS: cifs_mount failed w/return code = -13
Microsoft Knowledge Base says, this error code means:
The logon request failed because the trust relationship between this workstation and the primary domain failed.
Uncomfortable finding:
A server which was perfectly able to connect and mount the same share - now throws the same error.
It seems that something on the Windows server side was changed...

Hm...
To be continued!


Links:
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

SOLUTION #1: Debian 6 (smbd v3.5.6)

Post by ^rooker »

[SOLUTION #1]:
Obviously something was changed on the Windows server side, since both: Debian 6 and Debian 8 were unable to connect - although Debian 6 connected perfectly fine in the past.

On Debian 6 (smbd v3.5.6), I had to add "sec=lanman" to the mount options:

Code: Select all

$ sudo mount -t cifs //some.windows-server.local/Sharename -o username=MyUser,sec=lanman /mnt/windows_server
Worked fine to get Debian 6 cifs-mounts up and running again! :D

Unfortunately, that doesn't work on Debian 8 :(
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
with dmesg:
[16808.955358] CIFS VFS: Send error in SessSetup = -5
[16808.956167] CIFS VFS: cifs_mount failed w/return code = -5
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

SOLUTION #2: Debian8 (smbd v4.2.10-Debian)

Post by ^rooker »

[SOLUTION #2]
On Debian8 (Jessie), 2 things need to be done:

1) Uninstall "winbind":

Code: Select all

$ apt-get remove winbind
Thanks to user "forest"'s answer on stackexchange.com
According to him, also the following bugreports are related:
2) Use "sec=ntlm":

Code: Select all

$ sudo mount -t cifs //some.windows-server.local/Sharename -o username=MyUser,sec=ntlm /mnt/windows_server
I'm actually getting tired of this fear of "hoping that windows shares still mount..."
Damn Microsoft! Why can't they properly document and/or release their network connectivity as Free Software library?
Obviously, 2007 is too long ago :(
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Samba: mount error(22): Invalid argument

Post by ^rooker »

*sigh*...

Same server/client constellation that worked with the above instructions, but now it can't mount the Windows Server. Again.
Non-working Samba version is "v4.2.10-Debian" (on Debian 8 Jessie).
Works with Samba version v3.5.6 (on Debian 6)

No updates/changes were made on the Debian side, but obviously some updates were installed on the Windows Server.

Trying to mount using "sec=ntlm" returns "Permission denied" (as above).
Tried workaround mentioned in ArchLinux Bug #43015: "[samba] cannot connect to samba shared files after 4.1.14-1 upgrade", but get the following error message:
mount error(22): Invalid argument
dmesg says:
[10190313.486226] Status code returned 0xc000000d NT_STATUS_INVALID_PARAMETER
[10190313.486235] CIFS VFS: Send error in SessSetup = -22
[10190313.486325] CIFS VFS: cifs_mount failed w/return code = -22
To be continued...
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply