I am very inexperienced when it comes to using a command-line interface, Linux, and the concept of folder/directory permissions (among many other administrator-type things).
I previously installed Syncthing on a machine running Ubuntu Server, and it worked very well for syncing my game server backups to my desktop PC.
Every time I want to do something new with that machine, I research online, try to make sense of what I find, and write out all the steps I take so that I will be able to easily repeat them in the future. I just like to get things running on the machine and leave it alone – I don’t have a good brain for command-line computing. I basically write a script (instructions) for myself to follow to set things up, and then follow the script every time I need to do it again. …But it’s OK, because I wasn’t trying to impress you anyway!
I am now updating my instructions for installing Syncthing along everything else on my server machine, with plans to reinstall everything and additionally set up a Plex media server. I imagine Syncthing will work great for transferring files to the media server from my PC and will allow me to have two identical copies for backup purposes.
However, this time around I am updating my instructions to make the server machine as secure as possible, including establishing the proper directory permissions, and I just can’t wrap my head around how that works.
At least one guide I found online for installing the Plex media server said I MUST set the user named “plex” as the owner of the directory containing my media library, in addition to all of its subdirectories (by running sudo chown -R plex: [media directory] ).
I am afraid that if the “plex” account is the owner of the entire media library, Syncthing will not have access to the files and subdirectories and will not be able to sync them.
I suppose I could set the permission of the media directory so that ANYONE has full permission to access its contents, including Syncthing, but my research seems to indicate this is not a good idea. I don’t know what permission level is appropriate for my media library directory – I had figured 700, but now I am not sure.
I don’t even know if Syncthing has its own user account by default, like Plex apparently does, which I could perhaps put into a group with the “plex” user and then somehow give that group ownership of the media library directory. But then would I be able to access the contents myself, since my own account is no longer the owner, or do I need to add myself to the same group along with the “plex” user and “syncthing” user?
Or, will I be able to access the contents of any directory I don’t own by typing “sudo” in front of cd, or when running a program that needs to access those folders?
Furthermore, I don’t know what happens with newly added content AFTER the “plex” user becomes the owner of my entire media library and all its subdirectories. Every time new content is added to my media library, which would normally be via a Syncthing transfer from my PC, do I have to “chown” that content to the plex user again, every time? (Sorry, I know that question has nothing to do with Syncthing itself.)
My goal is simply to maximize security or follow best practices while allowing Syncthing and Plex to run smoothly, and to be able to access the media directory and files myself when necessary.
I could probably tinker and figure some of this out for myself, but I’m really just hoping to get things right the first time and not spend a lot of time scratching my head and trying to keep track of mistakes and fix them. It’s just the way my brain works (or doesn’t work). And I don’t know what is best practice, what is normal to do, or what potential problems could arise down the road from my decisions.
I’d just like to get it right, set it, and forget it.
I appreciate any help. Thank you!