You are not logged in.
I am trying to configure home directories but currently am being presented with "Access forbidden!".
I am trying to follow the "piter" advice note on the wiki as I don't want users to be able to read from other users home folders.
[root@host ~]# groupadd pubhtml
[root@host ~]# usermod -aG pubhtml http
[root@host ~]# chmod g+xr-w /home/*
[root@host ~]# chmod g+xr-w /home/*/public_htmlI have tried chmoding the users home folder rather than relying on the wildcard (*) too
access_log
xx.xx.xx.xx - - [07/Feb/2013:10:10:58 +0000] "GET /~user HTTP/1.1" 403 1057error_log
[Thu Feb 07 10:15:14 2013] [error] [client xx.xx.xx.xx] (13)Permission denied: access to /~user denied (filesystem path '/home/user/public_html') because search permissions are missing on a component of the pathhttps://wiki.archlinux.org/index.php/Ap … irectories
Last edited by Swarfega (2013-02-07 13:02:21)
Offline
Are the home directories owned by the pubhtml group?
You only need execute permissions on the user directories btw. If it was me, I'd just set "chmod g=,o=x /home/*", and "chmod g=,o=rx /home/*/public_html".
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
The folders are owned by the user who's home folder it is.
Forgive me but what does g= do? I'm guessing o=x sets the owner to be able to execute?
I want directory listing to work. Would that mean I cannot use your permissions?
*Edit*
I applied your permissions to one test account and indeed it works, but I wanted directory listing available.
Last edited by Swarfega (2013-02-07 11:35:07)
Offline
Basic permissions:
Each file/directory has:
permissions for an owning user.
permissions for an owning group.
and permissions for other users.
chmod [ugo]= sets the permissions explicitly, rather than adding([ugo]+) or removing([ugo]-) permissions for the current values. Commas separate these alterations, so you can specify multiple changes in a single chmod invocation.
"g=" sets the groups permissions to no read, no write, and no execute (which I believe is the default on user home directories).
I was asking about the group ownership of the directories, because the commands you posted showed that you just created the group and added the http user to it, you didn't chgrp the directories to the new group.
If you want directory listings available, then the http user needs read permissions on the directories too. In that case setting the groups up would be preferable. You probably don't want "others" to be able to list your files too.
Last edited by WorMzy (2013-02-07 11:47:46)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Nice in-depth explanation there, thanks.
I've set the group to pubhtml for sub-folders and files. If I check each directory now its group is pubhtml. I am still seeing access denied on empty folders and directly on files though?
-rwxr-x--- 1 user pubhtml 1 Feb 7 11:34 index.phpOffline
Try restarting apache, group changes don't take effect until the next time the user starts a new session (or in this case the process is restarted).
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
100% correct. It took a httpd restart and started working. Thanks WorMzy!
Offline