I want to use the same directory across these services".
That is what the "group" is for. Use the same group, set permissions for the group for a much as you want it for (directory, services, ftp login) can use that directory.
You can alter permissions, besides using chmod
, also through ACL.
POSIX Access Control Lists (ACLs) are more fine-grained access rights for files and directories. An ACL consists of entries specifying access permissions on an associated object. ACLs can be configured per user, per group or via the effective rights mask.
These permissions apply to an individual user or a group, and use the same as rwx
found in regular permissions.
Example 2, I have personally directory that contains sensitive personal data which uses SFTP depending on the user I use to connect it's either read-only or has write permissions. Now if I use the SFTP than samba has to be read only and if I make samba have write permissions then it breaks SFTP.
Read weird to me. But I would assume you can avoid this using bindfs
.
On apple systems you can create hard links to dir along if it doesn't create an circular path. I am quite surprise that this doesn't exist in Linux assuming someone is using GNU ontop. I
I am not surprised and no... MacOS, by allowing that, crippled core utilities and in my opinion it was a stupid move. You also need to use 3rd party scripts to fix parts of what that caused (ln
is broken, and you can not undo a hard link from command line).
What you should be using is bindfs
. MacOS should have added support for that a decade ago. It works in all modern Linux, Unix, and BSD (Catalina was the 1st MacOS iirc).
bindfs
Mount a directory to another location and alter permission bits.
bindfs
is a FUSE filesystem for mounting a directory to another location, similarly to mount --bind
. The permissions inside the mountpoint can be altered using various rules.
See the link for more but from what you posted it seems to me to be an answer to all your issues.