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.

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.

|improve this answer|||||
  • thanks, fiexed it. yum install acl, then do the code you given – yuli chika Nov 19 '14 at 8:54

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.