1

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.

2
  • Correct, that answer did solve my question. But it wasn't the root cause of my real issue...
    – Nicsoft
    Mar 12, 2013 at 20:04
  • See 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
    – kbulgrien
    Jul 20, 2018 at 18:04

1 Answer 1

3

You don't need to change this if you're using the default targeted SELinux policy; it's ignored.

3
  • Ok. 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.
    – Nicsoft
    Mar 12, 2013 at 20:01
  • 1
    You should probably completely rewrite your question from scratch. Mar 12, 2013 at 20:03
  • You actually answered the question I asked and that is that it's not needed.
    – Nicsoft
    Mar 12, 2013 at 20:28

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