1

I have a Centos 6 Linux box. I read tutorials on SELinux and wanted to try it out. Here are steps I followed,

  1. set SELINUX=enforcing in /etc/selinux/config
  2. turned on SELINUX with setenforce 1
  3. service httpd restart
  4. changed type on a php script file.

    from httpd_sys_content_t to something else eg: init_t (maybe this is not suitable type to test with?)

    chcon -t init_t /var/www/html/index.php

I hoped to get an error when I browsed to this file with web browser, but alas I was still able to see contents.

dawud
  • 15,096
  • 3
  • 42
  • 61

1 Answers1

0

There is no need to relabel the whole system (this would be done with touch /.autorelabel; reboot instead of restorecon). Relabeling of /var/www/html using restorecon -Fr /var/www/html should be enough, then run your test again, assuming that yo did not change the file context of this directory using semanage.

Markus
  • 1
  • 1