Prevent clients from deleting files on server
I have Linux Mint 19.2 XFCE acting as a media server (samba shares) for our movies and music. We use various streaming devices and their apps (Firestick, Roku, VLC, Plex...) to access the media files. My end goal is to prevent these devices/apps from deleting the music and movies files but be able to write files they need for their operation (playlists, bookmarks...). I don't know how to accomplish this but some thoughts I had were:
1) Create a samba user that has read, write permission but not delete. 2) Adjust permissions for the music and movie files themselves so that only the owner can delete. The problem with this might be that I would have to adjust permission for each new music or movie file I add in the future. 3) Simply prevent any user that is not physically on the Linux machine from deleting files. I would greatly appreciate help with this. |
you missed an important point: adding and deleting files requires write permission on the directory, not on the file.
I would rather suggest you to make the whole thing read-only and users can put their bookmarks and playlists into (inside) their homes. |
Okay. How do I do that? Is is possible to set up so that clients are read only and I/user directly on the server can have full access? Thanks again.
|
I don't think that the Linux permission system can distinguish between local and remote accounts.
However, since each of your devices has its own account when accessing the Samba server, you could use ACLs to remove write permissions from a directory: Code:
setfacl -m USER:r-x DIRECTORY |
I created a new user in Linux named streamer. Then I edited /etc/samba/smb.conf to give me (user1) full read/write access and Streamer read only with
Code:
[SharedMedia] |
All times are GMT -5. The time now is 02:08 AM. |