728x90
반응형
SMALL

1. 개요

 - SElinux를 사용중이라면 간혹 Crontab 설정 내용중 일부가 실행되지 않는 경우가 발생된다

   이유는 시스템의애플리케이션,  프로세스, 파일에 대한 액세스 제어를 정의하고 있기 때문이다 

 - SElinux(Security-Enhanced Linux)는 쉽게 표현한다면 Windows UAC(User Account Control)와 비슷하다고 볼 수도 있다

 

2. SElinux 상태 확인 방법

 a. sestatus

  - SElinux 사용중인 상태

$ sestatus

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      31

  -  SElinux 중지인 상태

$ sestatus

SELinux status:                 disabled

 

 b. getenforce

  - SElinux 사용중인 상태

$ getenforce

Enforcing

  -  SElinux 중지인 상태

$ getenforce

Disabled

 

3. SElinux Disable 방법

 a. File Path

$ /etc/selinux/config

or

$ /etc/sysconfig/selinux

 b. File 내용 수정

  - 'SELINUX=enforcing'을 'SELINUX=disabled'로 수정 후 저장한다

# 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=enforcing
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

 c. OS Rebooting

※ SElinux 설정은 'SELinux root directory' File Path를 확인 후 수정하거나 SElinux 설정이 있는 곳 전부 수정한다

   간혹 설정했음에도 SElinux 상태가 사용중으로 나온다면 지정된 경로의 File을 수정하지 않아서 사용중으로 나온 것이다

 

4. SElinux 임시 Disable 방법

 - Service를 운영중인 상태에서 OS Rebooting하기에 어려움이 있는 경우가 있다

    이때 임시 방편으로 SElinux를 중지하는 방법이 있다

 - 임시 비활성화 명령어

$ setenforce 0

 - 'sestatus' 조회 시 Current mode가 'enforcing'에서 'permissive'로 뀌며, 'getenforce' 조회 시 'Permissive'로 조회된다

728x90
반응형
LIST

'IT > Linux' 카테고리의 다른 글

[Linux] Open JDK 설치 방법  (0) 2023.05.04
[Linux] SSH Port 변경 방법  (0) 2023.05.04
[Linux] HDD 용량 Full로 인한 mount Error 조치  (0) 2023.05.04
[Linux] mySQL Service 명령어  (0) 2022.04.14
[Linux] Apache 서버 정보 숨기기  (0) 2021.04.02

+ Recent posts