I'm working with PHP, and I'm trying to access a folder of another user, and I always get the error "Permission denied".
I have created a group, added both users and grant access. It doesn't help, and here is what I did (from root access):
sudo usermod -a -G mygroup tools sudo usermod -a -G mygroup user2 sudo chgrp -R mygroup /home/tools/domains/domain.tools.com/public_html/storage/users sudo chmod -R 2775 /home/tools/domains/domain.tools.com/public_html/storage/users chmod ug+rwx -R /home/tools/domains/domain.tools.com/public_html/storage/users
Now, when I'm trying to access the folder from the user "tools" (where this folder is located), I can do it easily with no problem:
[tools@server ~]$ ls -l /home/tools/domains/domain.tools.com/public_html/storage/users total 4 drwxrwsr-x 7 root mygroup 4096 Dec 18 17:36 id
But, if I try to access this folder from a different user (in the same group), I get this error:
[user2@server ~]$ ls -l /home/tools/domains/domain.tools.com/public_html/storage/users ls: cannot access /home/tools/domains/domain.tools.com/public_html/storage/users: Permission denied
How can I fix this problem?