[CentOS] Help with httpd userdir recovery

Leonard den Ottolander leonard at den.ottolander.nl
Tue Dec 27 16:48:44 UTC 2016


Hello Robert,

On Tue, 2016-12-27 at 10:25 -0500, Robert Moskowitz wrote:
> I can display the /home/rgm/public_html/index.html file that only has 
> "Hello World' in it (to prevent anyone from walking my file tree from 
> the root).

To prevent people walking a directory structure you better disable
Options Indexes.

> But when I try to display the files in a subdir with ipaddr/~rgm/mydir
> 
> I get
> 
> You don't have permission to access /~rgm/mydir/ on this server.

The fact that you see the index page makes me assume SELinux is not the
problem. If you do have it enabled you might want to check out the
sebooleans that affect apache.

$ getsebool -a | grep http

httpd_enable_homedirs is one of those.

Remember that file access is based on file permissions in combination
with file ownership. This means that if apache is neither owner nor
group owner of a file world must have read access for apache to access
such files. A 711 permission on a directory is then insufficient. It
allows apache to cd to, but not read the directory.

Regards,
Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research





More information about the CentOS mailing list