JMK8
Posts: 94
Joined: Tue Apr 28, 2015 10:00 am

SMB share permissions.

Fri Jun 18, 2021 6:03 pm

I have a directory on my Pi that I share on my local network with Samba. The relevant part of smb.conf is:

Code: Select all

[remfiles]
path = /home/remdata
read only = no
public = yes
writable = yes
Windows users can map this directory and read the files but they are unable to delete them. They need to delete these files after they use them.
Even if the permissions of the files in the Pi directory are set to 0666, they are still unable to delete them from their Windows machines. I cannot see what I am doing wrong – any help?

User avatar
thagrol
Posts: 5262
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: SMB share permissions.

Fri Jun 18, 2021 6:54 pm

What are the permissions on /home/remdata ? IIRC to delete (and probably to add new files) directory permissions also need to allow writing.

In the underlying OS/file system not in smb.conf.

Oh, unless remdata is a local user, the traditional location would be /srv/remdata not /home/remdata. Just saying. Nothing forces you to use that.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

LTolledo
Posts: 5560
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: SMB share permissions.

Fri Jun 18, 2021 9:51 pm

requirements for deletion:
ownership: accessing user same as owner or part of group of owner of the file
file permissions: read/write permission on the file

usually I set the whole share directory at 0775. (root and owner have full access, others have read/execute access only)
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
thagrol
Posts: 5262
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: SMB share permissions.

Fri Jun 18, 2021 10:49 pm

LTolledo wrote:
Fri Jun 18, 2021 9:51 pm
usually I set the whole share directory at 0775. (root and owner have full access, others have read/execute access only)
Did you mean 755? 775 gives write access to memebers of the owning group.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

JMK8
Posts: 94
Joined: Tue Apr 28, 2015 10:00 am

Re: SMB share permissions.

Sat Jun 19, 2021 9:20 am

Magic!! The directory permissions fixed it - why didn't I think of that :oops:

Thanks both of you.

LTolledo
Posts: 5560
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: SMB share permissions.

Sat Jun 19, 2021 12:17 pm

glad to be of service :D
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “Networking and servers”