{"id":3652,"date":"2015-11-20T09:20:34","date_gmt":"2015-11-20T09:20:34","guid":{"rendered":"http:\/\/www.theperfectarts.com\/?p=3652"},"modified":"2016-04-10T09:26:07","modified_gmt":"2016-04-10T09:26:07","slug":"script-to-disable-selinux","status":"publish","type":"post","link":"https:\/\/www.ktchost.com\/blog\/script-to-disable-selinux\/","title":{"rendered":"Script to disable SeLinux"},"content":{"rendered":"<p>Many time we have faced an issue because SeLinux enabled on server after rebooting the server, to resolve the issue<br \/>\npermanently add the following script in the rc.local boot file, so that by default SeLinux will be disabled.<\/p>\n<p>Login into the server and create the new script file.<\/p>\n<p>nano \/root\/selinux.sh<\/p>\n<p>insert the following code in the selinux.sh file<\/p>\n<blockquote><p>if [ -f &#8220;\/usr\/sbin\/getenforce&#8221; ] &amp;&amp; [ `id -u` = 0 ] ; then<br \/>\nselinux_status=`\/usr\/sbin\/getenforce`<br \/>\n\/usr\/sbin\/setenforce 0 2&gt; \/dev\/null<br \/>\nfi<\/p><\/blockquote>\n<p>Open the file \/etc\/rc.local and add the following line , so that it will execute once server rebooted.<\/p>\n<p>sh \/root\/selinux.sh<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Many time we have faced an issue because SeLinux enabled on server after rebooting the server, to resolve the issue permanently add the following script <a class=\"mh-excerpt-more\" href=\"https:\/\/www.ktchost.com\/blog\/script-to-disable-selinux\/\" title=\"Script to disable SeLinux\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":4010,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,40],"tags":[],"class_list":["post-3652","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos-server","category-scripts"],"_links":{"self":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/3652"}],"collection":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/comments?post=3652"}],"version-history":[{"count":9,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/3652\/revisions"}],"predecessor-version":[{"id":4009,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/3652\/revisions\/4009"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media\/4010"}],"wp:attachment":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media?parent=3652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/categories?post=3652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/tags?post=3652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}