process_usershare_file: stat of failed. Permission denied Samba
Asked Answered
L

2

15

I created a shared folder using samba in ubuntu to enable windows machines can access it with the following command:

$ sudo net usershare add documents /home/developer/documents "Developer documents" everyone:F guest_ok=y

I give 777 permissions to the folder:

$ sudo chmod 0777 /home/developer/documents

And then I check what I've done

$ sudo net usershare info --long

When I want to see if the folder is visible from all windows machine, you can see. However, you cann't access that folder and get error of: "Permission Denied"

The message in: /var/log/samba/log.ip-domain is:

process_usershare_file: stat of /var/lib/samba/usershares/backuparsac failed. Permission denied

Then, I try to add some rules to my smb.conf

[documents]
   comment = Documents for Developers
   path = /home/developer/documents
   browseable = yes
   writable = yes
   read only = yes
   guest ok = yes
   directory mask = 0777

but the error of Permission denied keeps coming. Is there anything else I need to do? I need this folder can be accessed by all windows machines.

NOTE: I use Ubuntu 14.04

L answered 11/8, 2014 at 18:12 Comment(2)
Aren't you on Ubuntu 14.04 ? I have similar problem on it and cannot make it work. Tried by installing libpam-smbpass, and cifs-utils, but nothing made the error go awayTreasure
You have both read only = yes and writable = yes - that might also not workNochur
D
14

The cause is that Samba does not synchronize its users with the system. This solved the issue in my case, on Kubuntu 14.10:

sudo apt-get install libpam-smbpass
sudo service samba restart

If you don't want to synchronize users with PAM, simply add a user to Samba's password database:

sudo smbpasswd -a <user>

After that, the user will be able to open shared folders on the Samba machine.

Discalced answered 7/10, 2014 at 12:19 Comment(4)
Installing libpam-smbpass worked for me, but instead of restarting samba service or either smbd service, worked just after restarting the computer.Waistcoat
Rather than rebooting can use sudo service nmbd stop and sudo service smbd stop. I always stop nmbd as well just to make sure. Then repeat the above two commands replacing stop with start.Boyla
Worked for me too, but I had to reboot (Linux Mint 17.3). Just restarting samba, nmbd, or smbd didn't do it. When I rebooted, I got a popup when signing back in saying "User added: <myusername>" which I suspect was libpam-smbpass doing its job.Cofield
A year after the answer, the package was removed: lists.samba.org/archive/samba-cvs/2015-October/111473.htmlChaff
T
6

Your configuration file seems to be fine.

I reckon there might be a permission issue in your parent folder.

I suggest you check /home and /home/developer both have 755 rather than 750 permission.

Then check sudo -u nobody ls /home/developer/documents.

If ls is successful, the samba is likely to work as you expected as well

Tracheotomy answered 6/9, 2014 at 12:33 Comment(1)
I totally missed the x flag, I don't think its represented well in nautilus file permissions dialog.Eadwine

© 2022 - 2024 — McMap. All rights reserved.