본문 바로가기
IT/LINUX

[LINUX] SELINUX 모드 설정하기

by 양눈 2016. 12. 23.

[LINUX] SELINUX 모드 설정하기

   

/etc/selinux/config 파일 내에 3가지 옵션이 있습니다.

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

   

리눅스를 신규로 설치하게 되면 기본모드는 Enforcing이 됩니다

보안이 강화 되어있지만 테스트등을 진행시 제약사항이 많기 때문에 테스트시에는 disable 해서 사용합니다.

   

1 리부팅시 disable 시키기

# cat /etc/selinux/config

# 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 --> 설정값 변경

   

-- 리부팅 확인

# getenforce

Disabled

   

   

2. 명령어로 모드 설정하기

Enforcing 또는 Permissive 상태에서는 setenforce 명령으로 전환이 가능합니다.

Disable 상태에서는 적용이 되지 않습니다. 1 Enforcing 0 Permissive 입니다.

변경후 getenforce 명령으로 현재 모드를 확인합니다.

온라인에서 모드를 변경하더라도 리부팅시 /etc/selinux/config 파일의 설정값으로 원복 됩니다.

   

# setenforce 1

# getenforce

Enforcing

   

# setenforce 0

# getenforce

Permissive

   

   

   

   

댓글