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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content