started learning server deployment. Until the end did not understand about chmod , chown ... please explain:
on the server, Apache \ PHP work from the www-data user, I created an ftp account, and gave it to a friend .. he went in and created a file there, say, 2.txt and PHP does not want to work with it in any way, because the owner of this file is this ftuser , which is logical (the one who created it)
-rw-r--r-- 1 www-data www-data 8 окт 18 07:06 1.txt -rw-r--r-- 1 ftpuser ftpuser 0 окт 18 07:14 2.txt but the file above which is (1.txt) is created via php
I understand that you can give the rights manually, but I wanted everything to be automated ... so that php and ftp-user could work with files
works on vsftpd
although ftp account added to the group ...
root@serv:~# groups ftpuser ftpuser : www-data
-rw-r--r--only rights for the group:-rw-r--r--, so it does not matter that there is a user in the group. - Evgenii Izhboldin