You can either set permissions for the folder on
chmod 777 -R /path/to/folder
that you absolutely should not do, since everyone can write and execute everything in this directory afterwards
or, what would I prefer, you create a new group, call her in the group:
sudo groupadd usergroup
Now that the group exists, add two users to it:
sudo usermod -a -G usergroup <your username> sudo usermod -a -G usergroup www-data
Now all that remains is to set the access rights to the directory:
sudo chgrp -R usergroup /path/to/the/directory sudo chmod -R 770 /path/to/the/directory // <<<<<< change this to 775
Now only members of a group can read, write, or execute files and folders in a directory. Note the -R argument to the chmod and chgrp commands: this tells them that they recurs to each subdirectory of the target directory and change every available file and directory.
You can also change 770 to something like 774 if you want others to be able to read files, 775 if you want others to read and execute files, etc. Group assignment changes do not take effect until users log out and back.
In your case, you must finally change it to 775 after ...
source share