Www-data User to Access files/folder outside of /var/www/

后端 未结 2 1622
一生所求
一生所求 2021-01-19 06:30

Ok, is there a way for the PHP user (www-data) to gain access to other parts of the server, for example, /home/username/another_folder/ ?? Thanks in Advance.

Will<

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-19 07:16

    You could change the group ownership (chgrp) of your folder to www-data (if www-data is its own group.)

    You could change the user ownership of that folder (chown) and chmod it so that multiple users can access it. (Like farzad said)

    You could create a group ("me_and_web") whose only members are "username" and "www-data", and chgrp -R me_and_web /home/username/another_folder

提交回复
热议问题