Thursday, October 25, 2018

Give SFTP users and Apache write permissions on same folders




I have a centos6 web server where developers also upload by connecting through SFTP. So, to give developer login write permissions, I have change /var/www user to that user. My current permissions are:
developer:root
and with these, SFTP developer login can upload files, but apache can't upload files in them even with 777 permissions. I even tried with setting permissions like developer:apache, but of no avail.



How would I give both Apache and SFTP login write permissions at the same time?


Answer



i would recommend you to use acls here:



setfacl -R -m user:apache:rwx directory

setfacl -R -d -m user:apache:rwx directory
setfacl -R -m user:developer:rwx directory
setfacl -R -d -m user:developer:rwx directory

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...