Change unconfined_u to system_u is failing
You don't need to change this if you're using the default targeted SELinux policy; it's ignored.
Related videos on Youtube
Nicsoft
Updated on September 18, 2022Comments
-
Nicsoft almost 2 years
I've got a file on my apache/linux server. ls -Z gives:
drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 localization.smicloud.org
I need to change unconfined_u to system_u like all my other dirs.
I have been googling and on several places I found info that this is how to do it:
semanage fcontext -a -t httpd_sys_content_t localization.smicloud.org
and
semanage fcontext -a -t httpd_sys_rw_content_t localization.smicloud.org
Those give following error:
libsemanage.get_home_dirs: netbeans homedir /var/www/html or its parent directory conflicts with a file context already specified in the policy. This usually indicates an incorrectly defined system account. If it is a system account please make sure its uid is less than 500 or its login shell is /sbin/nologin.
I'm not really sure why netbeans is mentioned. It is my development tool but it's not present in the information about the directory. The directory is empty!
How can I fix this?
Update
I wasn't to clear about my real problem: I am trying to use Netbeans to ftp my files to this folder. It works for all other folders and the only difference I can see between this and those is this part.
-
Nicsoft over 11 yearsCorrect, that answer did solve my question. But it wasn't the root cause of my real issue...
-
kbulgrien almost 6 yearsSee also an answer that provides a solution for setting the user context. In summary, the restorecon -F flag is required to modify user context. unix.stackexchange.com/a/379029/22653
-
-
Nicsoft over 11 yearsOk. I wasn't really to clear what my problem really was. I am trying to use Netbeans to ftp my files to this folder. It works for all other folders and the only difference I can see between this and those is this part. Is this still irrelevant? Updating my question.
-
Michael Hampton over 11 yearsYou should probably completely rewrite your question from scratch.
-
Nicsoft over 11 yearsYou actually answered the question I asked and that is that it's not needed.