Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
Re: [opensuse] mount a CIFS share - permission denied
  • From: Vojtěch Zeisek <vojtech.zeisek@xxxxxxxxxxxx>
  • Date: Thu, 15 Jun 2017 09:11:12 +0200
  • Message-id: <12481536.5qa4e1P4Cp@tilia>
Dne čtvrtek 15. června 2017 0:55:58 CEST, David C. Rankin napsal(a):
On 06/14/2017 04:04 PM, Mikhail Ramendik wrote:
My wi-fi router can share the contents of a USB device using FTP and
Samba. I am trying to use this. Windows 7 has connected to the device
flawlwssly when I gave it the right username and password.

So I have also put a line into /etc/fstab:

//192.168.1.254/usbuser /media/share cifs
auto,uid=misha,gid=users,credentials=/etc/smbpassword 0 0

(all on one ine)

/etc/smbpassword is

user = usbuser
password = the_right_password_that_works_with_windows

Generally the credentials file should be a per-user file that should have
0600 permission and has the format:

username=yourusername
password=yourpassword

Yes. Not 'user'. There also can be (if relevant) 'domain=XXX'.

you would generally put it somewhere like $HOME/.config/smb/smbcred

If you are the only user, then I guess it doesn't matter.

It does.

and yet, I get an error 13 permission denied. dmesg has:

[12913.915270] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[12913.915275] CIFS VFS: Send error in SessSetup = -13
[12913.915334] CIFS VFS: cifs_mount failed w/return code = -13

How do I get it to mount the share?

There is a good chance your wifi router only supports NTLMv1 access. If so,
then try adding the option, 'sec=ntlm' to your mount string, e.g.

# mount.cifs //server/share /mnt/point -o sec=ntlm,...

(you can also use smbclient to test, e.g.
smbclient -Uusername-Lhost -Acredentialfile)

If your router supports NTLMv2, try adding the option `sec=ntlmssp` to your
normal mount string, e.g.

# mount.cifs //server/share /mnt/point -o sec=ntlmssp,...

There have been a number of changes in samba's auth mechanism over the past
year or so, and I haven't kept up with all of them. You may want to look at
man smb.conf under the 'lanman auth' section and search on 'ntlm' to see if
there have been any recent additions or changes.

I think he is missing user mapping. I use:

sudo mount.cifs //win.server/Path /mnt -o credentials=/home/USER/
cifs.txt,uid=USER,gid=users

Normal user does not have any permission to see content of Windows share.
Also, the mounted directory must be readable for user in the credentials file.

--
Vojtěch Zeisek
https://trapa.cz/
< Previous Next >
Follow Ups