0

I've a RHEL 5 machine with SELinux disabled.

sestatus -v
SELinux status: disabled

What is the effect of SELinux context on a user's home directory?

ls -lZ -d zxtdfg  
drwx------  zxtdfg dba user_u:object_r:user_home_dir_t:s0 zxtdfg

Is it possible to modify/remove the SELinux context of a single file/directory?

Also I have created a test user with normal useradd command. It doesn't have any SELinux context attributes.

ls -lZ -d test  
drwx------  604 604                         test

Can we add the SELinux context to this user's home directory?

1 Answer 1

1

In a machine whith SELinux disabled, the context has no function whatsoever.

It is possible to modify the context of files and directories both temporary and permanently. The tools you need to check are chcon(1) and semanage(8), respectively.

After disabling SELinux, there is no point in labeling files. You would need to re-enable SELinux, force a whole system relabel, and use restorecon(8) on remaining unlabeled files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .