Security Context Redhat


Setelah menyalin data dari remote server, ternyata file yang telah didapatkan tidak dapat diakses dari halaman web. Padahal file lain yang dibuat belakangan dapat diakses oleh klien web. Hal ini aneh karena properti permisi file telah diatur sama yaitu 544. Namun perbedaan itu ditampilkan setelah properti security context file juga ditampilkan.

[root@gedhang-ghoreng ~]# ls -alZ

drwxr-xr-x root root root:object_r:httpd_sys_content_t .

drwxr-xr-x root root system_u:object_r:httpd_sys_content_t ..

-rw-r–r– root root root:object_r:httpd_sys_content_t coba.php

-rw-r–r– root root root:object_r:httpd_sys_content_t crossdomain.xml

-rw-r–r– root root root:object_r:httpd_sys_content_t download_offline_doc.php

-rw-r–r– root root root:object_r:httpd_sys_content_t download_offline_docx.php

-rw-r–r– root root root:object_r:httpd_sys_content_t download_online_doc.php

-rw-r–r– root root root:object_r:httpd_sys_content_t download_online_docx.php

drwxr-xr-x root root root:object_r:user_home_t newfolder1

-rw-r–r– root root root:object_r:httpd_sys_content_t embed.php

-rw-r–r– root root root:object_r:httpd_sys_content_t fevent.php

-rw-r–r– root root root:object_r:httpd_sys_content_t howtoembed.php

-rw-r–r– root root root:object_r:httpd_sys_content_t image.php

-rw-r–r– root root root:object_r:httpd_sys_content_t index_.html

-rw-r–r– root root root:object_r:httpd_sys_content_t index_.php

-rw-r–r– root root root:object_r:httpd_sys_content_t index.php

-rw-r–r– root root root:object_r:httpd_sys_content_t info.php

-rw-r–r– root root root:object_r:httpd_sys_content_t parse.php

drwxr-xr-x root root root:object_r:httpd_sys_content_t pma

-rw-r–r– root root root:object_r:httpd_sys_content_t science.php

-rw-r–r– root root root:object_r:httpd_sys_content_t sidebarnews.php

-rw-r–r– root root root:object_r:httpd_sys_content_t sorry.html

-rw-r–r– root root root:object_r:httpd_sys_content_t sorry.php

-rw-r–r– root root root:object_r:httpd_sys_content_t test.html.txt

-rw-r–r– root root root:object_r:httpd_sys_content_t test.php

-rw-r–r– root root root:object_r:httpd_sys_content_t video.php

-rw-r–r– root root root:object_r:httpd_sys_content_t web.config

-rw-r–r– root root root:object_r:httpd_sys_content_t welcome.png

-rw-r–r– root root root:object_r:httpd_sys_content_t x.html

-rw-r–r– root root root:object_r:httpd_sys_content_t x.php

terlihat security context pada direktori newfolder1 berbeda.

Setelah direstore menggunakan perintah restorecon -r newfolder1

[root@gedhang-ghoreng ~]# restorecon -r ../html/

hasilnya security context menjadi sama dengan file lainnya, dan kini dapat di akses dari klien web.

Ref: Mat’s Blog

About abunajiyah
A Programmer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: