>  기사  >  운영 및 유지보수  >  Selinux를 끄는 방법

Selinux를 끄는 방법

藏色散人
藏色散人원래의
2020-05-29 11:43:406139검색

Selinux를 끄는 방법

selinux를 끄는 방법은 무엇입니까?

selinux를 끄세요

1. "getenforce" 명령을 통해 selinux 상태를 확인하세요.

권장: "linux tutorial"

[root@localhost ~]# getenforce
Enforcing        //enforceing代表开启,
 
[root@localhost ~]# getenforce
Permissive      // permissive代表警告
 
[root@localhost ~]# getenforce
Disabled        //disabled代表关闭
[root@localhost ~]#

2. 터미널에 명령을 입력하세요. 이 방법은 일시적으로 닫혀 있으며, 다시 시작하면 아무런 효과가 없습니다.

[root@localhost ~]# setenforce 0    //关闭
[root@localhost ~]# getenforce
Permissive         
 
[root@localhost ~]# setenforce 1    //开启
[root@localhost ~]# getenforce
Enforcing

3. 구성 파일 "/etc/sysconfig/selinux"를 통해 selinux 상태를 수정하세요. 이 방법을 사용하려면 머신을 다시 시작해야 합니다

[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" "selinux를 끄려면 컴퓨터를 켤 때마다 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

위 내용은 Selinux를 끄는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.