pam_mkhomedir sets wrong selinux context

Solution In Progress - Updated -

Issue

When using pam_mkhomedir the selinux context is expected to be user_home_t not root_home_t. But after home directory creation, the context is root_home_t:

[username@host ~]$ ls -lZa .
drwxr-xr-x. username username unconfined_u:object_r:home_root_t:s0 .
drwxr-xr-x. root     root     system_u:object_r:home_root_t:s0 ..
-rw-r--r--. username username unconfined_u:object_r:home_root_t:s0 .bash_logout
-rw-r--r--. username username unconfined_u:object_r:home_root_t:s0 .bash_profile
[...]

Environment

  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.