這篇文章主要講解了“Linux服務(wù)器怎么關(guān)閉selinux”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“Linux服務(wù)器怎么關(guān)閉selinux”吧!

創(chuàng)新互聯(lián)建站是一家朝氣蓬勃的網(wǎng)站建設(shè)公司。公司專注于為企業(yè)提供信息化建設(shè)解決方案。從事網(wǎng)站開發(fā),網(wǎng)站制作,網(wǎng)站設(shè)計,網(wǎng)站模板,微信公眾號開發(fā),軟件開發(fā),
小程序設(shè)計,十載建站對
輕質(zhì)隔墻板等多個行業(yè),擁有多年的網(wǎng)站設(shè)計經(jīng)驗(yàn)。
關(guān)閉selinux
1、通過命令“getenforce”獲取selinux狀態(tài),
[root@localhost ~]# getenforce
Enforcing //enforceing 代表開啟,
[root@localhost ~]# getenforce
Permissive // permissive 代表警告
[root@localhost ~]# getenforce
Disabled //disabled 代表關(guān)閉
[root@localhost ~]#
|
2、在終端輸入命令即可關(guān)閉selinux,此種做法只是暫時關(guān)閉,重啟之后沒有效果
[root@localhost ~]# setenforce 0 // 關(guān)閉
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# setenforce 1 // 開啟
[root@localhost ~]# getenforce
Enforcing
|
3、通過配置文件“/etc/sysconfig/selinux”來修改selinux狀態(tài),此種做法需要重啟機(jī)器
[root@localhost ~]# gedit /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
|
4、通過修改“/boot/grub/menu.lst”來關(guān)閉selinux,這樣每次開機(jī)都不會啟動selinux
[root@localhost ~]# gedit /boot/grub/menu.lst
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-431.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.i686 ro root=/dev/mapper/VolGroup-lv_root nomodeset rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=auto vga=ask.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet selinux=0
initrd /initramfs-2.6.32-431.el6.i686.img
|
感謝各位的閱讀,以上就是“Linux服務(wù)器怎么關(guān)閉selinux”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對Linux服務(wù)器怎么關(guān)閉selinux這一問題有了更深刻的體會,具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點(diǎn)的文章,歡迎關(guān)注!
網(wǎng)站名稱:Linux服務(wù)器怎么關(guān)閉selinux-創(chuàng)新互聯(lián)
鏈接URL:http://chinadenli.net/article28/dgjpjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計、微信小程序、Google、定制網(wǎng)站、動態(tài)網(wǎng)站、微信公眾號
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源:
創(chuàng)新互聯(lián)