cifs access denied

Quick to answer questions about finding your way around LMDE as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums within the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
Watertower58
Level 1
Level 1
Posts: 3
Joined: Fri Dec 15, 2023 6:42 am

cifs access denied

Post by Watertower58 »

In my PC I can switch between two SSD drives.
On the first I have regular LM cinnamon, all works perfect.
When I install LMDE on the second, (and boot from it) I use the same fstab as on the regular LM, I get a cifs access denied error, when trying to mount my NAS shares.

So same hardware, same fstab file, same NAS shares.

Regular LM no problem whatsoever.

Is this because of beiing based on Debian instead of on Ubuntu?

And how can I fix this?
Cifs-utils is installed by default.
Thanks for any suggestion.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: cifs access denied

Post by altair4 »

What version of "regular" LM Cinnamon and what version of LMDE?

Share your fstab declaration for this connection: cat /etc/fstab | grep cifs

EDIT: You might want to post the output of this command as well so we can determine what the NAS is capable of:

Code: Select all

nmap --script smb-protocols ip-address-of-nas
If you haven't already install nmap:

Code: Select all

sudo apt install nmap
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
jjcojax
Level 5
Level 5
Posts: 610
Joined: Fri Apr 03, 2015 6:01 am
Location: Belgium

Re: cifs access denied

Post by jjcojax »

hello,
So same hardware, same fstab file, same NAS shares.
Same user ?
have user acces to sambashare group ?

Image

jjcojax
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: cifs access denied

Post by altair4 »

have user acces to sambashare group ?
The sambashare group has only one function. Only members of that group can create samba usershares ( the one's you create in the file manager ) for sharing folders to others on the network.
tester@vxub2204:~$ ls -dl /var/lib/samba/usershares
drwxrwx--T 2 root sambashare 4096 Jun 16 2023 /var/lib/samba/usershares
It has nothing to do with accessing other shares on the network.

And in this thread the OP isn't using samba on the client he's using mount.cifs.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Watertower58
Level 1
Level 1
Posts: 3
Joined: Fri Dec 15, 2023 6:42 am

Re: cifs access denied

Post by Watertower58 »

After installing LMDE 6 (Faye) again fresh, I tried again.
Same cifs error.
But when in terminal sudo mount -a all shares get added and are accessable.
So where can I look for those access rights?

The LM version I used on my other disk (same PC) aswell as on my Tuxedo laptop is 21.2 Cinnamon.
On those two (with the same shares and fstab and user) I never got this error.
So it must have something to do with the LMDE 6 Faye based on Debian (Cinnamon 5.8.4) I would think so.
I am not such an experienced Linux user yet, came from MAC OS and the dreadfull Windows.

Hope some can explain me what to do, to get rid of this error.
sudo mount -a works, but this is not the way it is supposed to be.
I have attached the fstab (as txt) file and error.
Attachments
fstab.txt
(1.29 KiB) Downloaded 57 times
Screenshot from 2023-12-16 14-57-38.png
Screenshot from 2023-12-16 14-57-38.png (7.31 KiB) Viewed 527 times
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: cifs access denied

Post by altair4 »

But when in terminal sudo mount -a all shares get added and are accessable.
Two possibilities:

[1] Your home directory ( where your credentials reside ) is encrypted so it's not available to fstab untill after you login which is too late for fstab.

[2] More likely it's a timing issue.

During boot the the system tries to execute the fstab instructions but the full network stack isn't operational yet so there's nothing to mount.

This happens a lot.

One way out of this is to do a systemd automount by adding the x-systemd.automount option to your fstab declaration.

There is one tinsy little problem with this however.

If you just add it to your declaration like this:
//192.168.178.35/documents /home/ron/NAS/Documents cifs credentials=/home/ron/.MyNAS-credentials,iocharset=utf8,noperm,x-systemd.automount 0 0
It may not be quite enough time to work as desired because another process ( udisks2 ) interferes with this and ties to mount at login.

The way out of this is to change your mount points to someplace other than /home/ron or /media - like under /mnt.

You can try adding x-systemd.automount to your existing fstab statements and it might work. If not change to a /mnt mountpoint.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Watertower58
Level 1
Level 1
Posts: 3
Joined: Fri Dec 15, 2023 6:42 am

Re: cifs access denied [SOLVED]

Post by Watertower58 »

I changed the mount points to /mnt/NAS/xxxx

I only changed one line in fstab to try it out.
It worked ....
Now I edited all the other lines from /home/ron/NAS/ to /mnt/NAS/
Reboot ... no errors ... but empty folders....

Reboot again .... now they are OK
Made bookmarks in Nemo to those folders.

Finally solved!
But can someone explain to me, why this is, under LMDE and not under LM?
A Debian thing?
I can only learn here.

Thanks everyone for the suggestions and help.
Post Reply

Return to “Beginner Questions”