0

I am running a vsftpd server with a few user accounts. Every user has his own, private directory set as chroot in which no one but he himself should write, like this:

ftphomes/
userdir1
userdir2
userdir3
...

So far this works, every file uploaded into these directories has the owner user:usergroup

However, I have a public directory (mounted into each userdir with mount --bind) in which everyone should have write permissions for everyones files. I created a group called ftpusergrop containing every user from the FTP server.

My goal is to set the owner of each file in the public directory to user:ftpusergroup and the permissions 774. Any help would be really appreciated

  • Let me get you, user ==> user, group ==> ftpusergroup. or your after just the group part? – George Udosen Oct 25 '17 at 12:39
  • Perhaps you wanted to look at the SETGID bit? It keeps the group owning the permission when a user creates a new file inside it. Does this answer look helpful?: serverfault.com/questions/306253/… – Robobenklein Oct 25 '17 at 14:19
0

Set up the ownership with:

sudo chown -R user:ftpusergroup /path/to/public_folder

Using sefacl set the permission bit:

sudo setfacl -R -d -m u:user:rwx,g:ftpusergroup:rwx,o::r /path/to/public_folder

Information:

-R: recursively

-d: set as default for future folders and files

-m: modify existing file access control settings

Source:

man setfacl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.