{"id":1237,"date":"2019-11-05T23:03:24","date_gmt":"2019-11-05T16:03:24","guid":{"rendered":"https:\/\/www.linuxid.net\/post\/?p=1237"},"modified":"2025-04-18T15:21:34","modified_gmt":"2025-04-18T08:21:34","slug":"cara-mudah-disable-selinux-di-centos-7","status":"publish","type":"post","link":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/","title":{"rendered":"Cara Mudah Disable SELinux di CentOS 7"},"content":{"rendered":"<p>Security Enhanced Linux atau <a href=\"https:\/\/selinuxproject.org\/page\/Main_Page\" target=\"_blank\" rel=\"noopener\">SELinux<\/a> adalah mekanisme keamanan yang dibangun ke dalam kernel Linux yang digunakan oleh distribusi berbasis RHEL.<\/p>\n<p>SELinux menambahkan lapisan keamanan tambahan ke sistem dengan memungkinkan administrator dan user untuk mengontrol akses ke objek berdasarkan aturan kebijakan.<\/p>\n<p>Aturan kebijakan SELinux menentukan bagaimana proses dan pengguna berinteraksi satu sama lain serta bagaimana proses dan pengguna berinteraksi dengan file. Ketika tidak ada aturan yang secara eksplisit mengizinkan akses ke objek, seperti untuk proses membuka file, maka akses akan ditolak.<\/p>\n<p>SELinux memiliki tiga mode operasi:<\/p>\n<ul>\n<li><strong>Enforcing<\/strong>: SELinux memungkinkan akses berdasarkan pada aturan kebijakan SELinux.<\/li>\n<li><strong>Permissive<\/strong>: SELinux hanya mencatat tindakan yang akan ditolak jika berjalan dalam mode penegakan. Mode ini berguna untuk debugging dan membuat aturan kebijakan baru.<\/li>\n<li><strong>Disabled<\/strong>: Tidak ada kebijakan SELinux yang dimuat, dan tidak ada pesan yang dicatat.<\/li>\n<\/ul>\n<p>Secara default, dalam CentOS 7, SELinux diaktifkan dan dalam mode enforcing. Sangat disarankan untuk menjaga SELinux dalam mode enforcing. Namun, kadang mode ini dapat mengganggu fungsi beberapa aplikasi, dan Anda perlu mengaturnya ke mode permissive atau bahkan menonaktifkannya sepenuhnya..\u00a0<span id=\"ezoic-pub-ad-placeholder-156\" class=\"ezoic-adpicker-ad\"\/><\/p>\n<p>Dalam tutorial ini, kami akan menjelaskan cara menonaktifkan SELinux di CentOS 7.<\/p>\n<h2>Prasyarat<\/h2>\n<p>Hanya pengguna root atau <a href=\"https:\/\/www.linuxid.net\/post\/cara-membuat-user-sudo-di-centos\/\">user dengan hak sudo<\/a> yang dapat mengubah mode SELinux.<\/p>\n<h2>Periksa Mode SELinux di CentOS 7<\/h2>\n<p>Gunakan perintah <code>sestatus<\/code> untuk memeriksa status dan mode di mana SELinux berjalan:<\/p>\n<pre>sestatus<\/pre>\n<pre>SELinux status:      enabled&#13;\nSELinuxfs mount:     \/sys\/fs\/selinux&#13;\nSELinux root directory:         \/etc\/selinux&#13;\nLoaded policy name:  targeted&#13;\nCurrent mode:        enforcing&#13;\nMode from config file:          enforcing&#13;\nPolicy MLS status:   enabled&#13;\nPolicy deny_unknown status:     allowed&#13;\nMemory protection checking:     actual (secure)&#13;\nMax kernel policy version:      31<\/pre>\n<p>Output di atas menunjukkan bahwa SELinux diaktifkan dan diatur ke mode <code>enforcing<\/code>.<\/p>\n<h2>Disable SELinux<\/h2>\n<p>Anda dapat mengubah sementara mode dari targeted menjadi permissive dengan perintah berikut:<\/p>\n<pre>sudo setenforce 0<\/pre>\n<p>Namun, perubahan ini hanya berlaku untuk sesi runtime saat ini dan akan kembali ke pengaturan awal saat reboot.<\/p>\n<p>Lakukan langkah-langkah di bawah ini untuk menonaktifkan SELinux pada sistem CentOS 7 Anda secara permanen:<\/p>\n<ol>\n<li>Buka file <code>\/etc\/selinux\/config<\/code>\u00a0dan ubah nilai <code>SELINUX<\/code>\u00a0menjadi\u00a0<code>disabled<\/code>:\n<pre>sudo vim \/etc\/selinux\/config<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-highlight=\"6\"># This file controls the state of SELinux on the system.&#13;\n# SELINUX= can take one of these three values:&#13;\n#       enforcing - SELinux security policy is enforced.&#13;\n#       permissive - SELinux prints warnings instead of enforcing.&#13;\n#       disabled - No SELinux policy is loaded.&#13;\nSELINUX=disabled&#13;\n# SELINUXTYPE= can take one of these three values:&#13;\n#     targeted - Targeted processes are protected,&#13;\n#     minimum - Modification of targeted policy. Only selected processes are protected. &#13;\n#     mls - Multi Level Security protection.&#13;\nSELINUXTYPE=targeted<\/pre>\n<\/li>\n<li>Simpan file dan <a href=\"https:\/\/www.linuxid.net\/post\/cara-reboot-linux-melalui-baris-perintah\/\">reboot<\/a> sistem:\n<pre>sudo shutdown -r now<\/pre>\n<\/li>\n<li>Ketika sistem di-boot, gunakan perintah <code>sestatus<\/code> untuk memverifikasi bahwa SELinux telah dinonaktifkan:\n<pre>sestatus<\/pre>\n<p>Outputnya akan terlihat seperti ini:<\/p>\n<pre>SELinux status:      disabled<\/pre>\n<\/li>\n<\/ol>\n<h2>Kesimpulan<\/h2>\n<p>SELinux adalah mekanisme untuk mengamankan sistem dengan menerapkan mandatory access control (MAC). SELinux diaktifkan secara default pada sistem CentOS 7, tetapi dapat dinonaktifkan dengan mengedit file konfigurasi dan reboot sistem.<\/p>\n<p>Untuk mempelajari lebih lanjut tentang fitur-fitur canggih SELinux, kunjungi panduan <a href=\"https:\/\/wiki.centos.org\/HowTos\/SELinux\" target=\"_blank\" rel=\"noopener\">CentOS SELinux<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Security Enhanced Linux atau SELinux adalah mekanisme keamanan yang dibangun ke dalam kernel Linux yang&hellip;<\/p>\n","protected":false},"author":2,"featured_media":1238,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[15,77,71,23],"class_list":["post-1237","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos","tag-centos-7","tag-file-system","tag-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cara Mudah Disable SELinux di CentOS 7 - Linuxid<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cara Mudah Disable SELinux di CentOS 7 - Linuxid\" \/>\n<meta property=\"og:description\" content=\"Security Enhanced Linux atau SELinux adalah mekanisme keamanan yang dibangun ke dalam kernel Linux yang&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"Linuxid\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-05T16:03:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-18T08:21:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"530\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"xsand\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Ditulis oleh\" \/>\n\t<meta name=\"twitter:data1\" content=\"xsand\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimasi waktu membaca\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 menit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/\",\"url\":\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/\",\"name\":\"Cara Mudah Disable SELinux di CentOS 7 - Linuxid\",\"isPartOf\":{\"@id\":\"https:\/\/linuxid.net\/post\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg\",\"datePublished\":\"2019-11-05T16:03:24+00:00\",\"dateModified\":\"2025-04-18T08:21:34+00:00\",\"author\":{\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#primaryimage\",\"url\":\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg\",\"contentUrl\":\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg\",\"width\":1000,\"height\":530},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Beranda\",\"item\":\"https:\/\/linuxid.net\/post\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cara Mudah Disable SELinux di CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/linuxid.net\/post\/#website\",\"url\":\"https:\/\/linuxid.net\/post\/\",\"name\":\"Linuxid\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/linuxid.net\/post\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"id\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79\",\"name\":\"xsand\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g\",\"caption\":\"xsand\"},\"url\":\"https:\/\/www.linuxid.net\/post\/author\/xsand\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cara Mudah Disable SELinux di CentOS 7 - Linuxid","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/","og_locale":"id_ID","og_type":"article","og_title":"Cara Mudah Disable SELinux di CentOS 7 - Linuxid","og_description":"Security Enhanced Linux atau SELinux adalah mekanisme keamanan yang dibangun ke dalam kernel Linux yang&hellip;","og_url":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/","og_site_name":"Linuxid","article_published_time":"2019-11-05T16:03:24+00:00","article_modified_time":"2025-04-18T08:21:34+00:00","og_image":[{"width":1000,"height":530,"url":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg","type":"image\/jpeg"}],"author":"xsand","twitter_card":"summary_large_image","twitter_misc":{"Ditulis oleh":"xsand","Estimasi waktu membaca":"2 menit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/","url":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/","name":"Cara Mudah Disable SELinux di CentOS 7 - Linuxid","isPartOf":{"@id":"https:\/\/linuxid.net\/post\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg","datePublished":"2019-11-05T16:03:24+00:00","dateModified":"2025-04-18T08:21:34+00:00","author":{"@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79"},"breadcrumb":{"@id":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/"]}]},{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#primaryimage","url":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg","contentUrl":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Mematikan-Fitur-SELinux-di-CentOS-7.jpg","width":1000,"height":530},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxid.net\/post\/cara-mudah-disable-selinux-di-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Beranda","item":"https:\/\/linuxid.net\/post\/"},{"@type":"ListItem","position":2,"name":"Cara Mudah Disable SELinux di CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/linuxid.net\/post\/#website","url":"https:\/\/linuxid.net\/post\/","name":"Linuxid","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxid.net\/post\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"id"},{"@type":"Person","@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79","name":"xsand","image":{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g","caption":"xsand"},"url":"https:\/\/www.linuxid.net\/post\/author\/xsand\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/comments?post=1237"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1237\/revisions"}],"predecessor-version":[{"id":2777,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1237\/revisions\/2777"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/media\/1238"}],"wp:attachment":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/media?parent=1237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/categories?post=1237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/tags?post=1237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}