3

I have some folder, need anybodies php scripts can create sub folder/files and unlink files.

I do sudo chown -R apache:apache /var/www/public_html/a

But after that, my ftp user cannot upload files in that folder.

And I do sudo chown -R yulichika:users /var/www/public_html/a

that ftp can access the folder, but anybodies php scripts with a wrong permisson.

I do not want set the whole folder with 0777, so how to chown 2 users with the permission to operate the same folder? thanks.

1 Answer 1

6

You can use access control lists commands.

First set owner apache to the directory

sudo chown -R apache:apache /var/www/public_html/a

Now set acl so that ftp user can upload folders.

FOR USER

sudo setfacl -R -m u:yulichika:rwx /var/www/public_html/a

FOR GROUP

sudo setfacl -R -m g:users:rwx /var/www/public_html/a

Hope this will solve your problem.

1
  • thanks, fiexed it. yum install acl, then do the code you given
    – yuli chika
    Nov 19, 2014 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .