# SELinux and UserDir

**URL:** <https://forums.rockylinux.org/t/selinux-and-userdir/13835>\
**Category:** Rocky Linux Help & Support\
**Created:** [May 1, 2024, 3:19pm UTC](https://forums.rockylinux.org/t/selinux-and-userdir/13835 "2024-05-01T15:19:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![codewarrior65](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@codewarrior65](https://forums.rockylinux.org/u/codewarrior65)\
**Post date:** [May 1, 2024, 3:19pm UTC](https://forums.rockylinux.org/t/selinux-and-userdir/13835/1 "2024-05-01T15:19:53Z")

</div>

Hello all,

New to the community. I am working on setting up my servers with Rocky 9.3 and allowing my users to have web directories. i.e public\_html. I have enabled the UserDir in /etc/httpd.conf/userdir.conf file and have set the SELinux boolean as follows: setsebool -P httpd\_enable\_homedirs true. I must be missing something as I still get an access error. This is just a local machine without https at this point.

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [May 1, 2024, 8:06pm UTC](https://forums.rockylinux.org/t/selinux-and-userdir/13835/2 "2024-05-01T20:06:50Z")

</div>

The user’s home directory needs to be set to at least mode 701 (`rwx-----x`), public\_html can be set to 755. Ensure you have set the proper permissions. Failing this, check the httpd logs in /var/log/httpd.

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [May 1, 2024, 9:04pm UTC](https://forums.rockylinux.org/t/selinux-and-userdir/13835/3 "2024-05-01T21:04:12Z")

</div>

> [@codewarrior65](#):
>
> I still get an access error

The “access error” can come from multiple places. First check selinux report to make sure it really is an seliux problem. It could be directory permissions, or it could be the web server doesn’t think it should allow browsing to the web “location”, not to be confused wtih the filesystem directory. Web server error log is a good place to start.

---

<div class="post-metadata">

**Author:** ![codewarrior65](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@codewarrior65](https://forums.rockylinux.org/u/codewarrior65)\
**Post date:** [May 1, 2024, 11:34pm UTC](https://forums.rockylinux.org/t/selinux-and-userdir/13835/4 "2024-05-01T23:34:41Z")

</div>

Solved it with setsebool -P httpd\_read\_user\_content on. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [June 30, 2024, 11:35pm UTC](https://forums.rockylinux.org/t/selinux-and-userdir/13835/5 "2024-06-30T23:35:25Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
