LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-23-2019, 09:22 PM   #1
DDE12
LQ Newbie
 
Registered: Nov 2019
Posts: 3

Rep: Reputation: Disabled
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.
 
Old 11-24-2019, 08:22 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,684

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
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.
 
Old 12-05-2019, 08:08 PM   #3
DDE12
LQ Newbie
 
Registered: Nov 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
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.
 
Old 12-05-2019, 09:15 PM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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 suppose Samba also allows you to set permissions on shares, but I would have to research the mechanism. Giving control to Samba is the cleaner solution in my opinion.
 
Old 02-16-2020, 07:44 PM   #5
DDE12
LQ Newbie
 
Registered: Nov 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
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]
path = /disks/ExternalMedia/SharedMedia
read only = Yes
valid users = user1, Streamer
write list = user1
See https://forums.linuxmint.com/viewtop...55991#p1755991 for more specific details and troubleshooting for some issues with sharing.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Server can ping clients, but clients cannot ping server and i cannot SSH into Server jzakharia Linux - Networking 5 07-05-2015 02:21 PM
[SOLVED] prevent deleting important files lahirushanaka Linux - Newbie 4 06-14-2014 06:53 PM
Prevent user from deleting files on pureftpd Skillz Linux - Software 2 02-21-2010 12:29 AM
Prevent root from deleting files on network mounts bobwall Linux - Server 9 08-28-2008 07:31 PM
Changing File Permission in a FTP directory to prevent deleting of files shawnbishop Linux - Software 3 01-10-2006 05:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration