selinux 安全機制 執行模式切換

2021-09-05 09:47:16 字數 1128 閱讀 2319

1.selinux 模式

enforcing (強制執行)

permissive(寬鬆)

disabled (徹底禁用)

2.檢視系統狀態

[root@room4pc09 桌面]# getenforce 

disabled

3.修改臨時模式,重啟後恢復到預設狀態

[root@room4pc09 桌面]# setenforce 0  #切換為permissive(寬鬆)模式

[root@room4pc09 桌面]# setenforce 1 #切換enforcing (強制執行)模式

4.永久模式 ,vim修改配置檔案

[root@room4pc09 桌面]# vim  /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 #把disabled 修改其它模式就可以

# selinuxtype= can take one of three two values:

# targeted - targeted processes are protected,

# minimum - modification of targeted policy. only selected processes are protected.

# mls - multi level security protection.

selinuxtype=targeted

SELinux安全防護

實現此案例需要按照如下步驟進行。步驟一 將linux伺服器的selinux設為enforcing強制模式 1 固定配置 修改 etc selinux config檔案 確認或修改selinux為enforcing模式 root svr5 vim etc selinux config selinux ...

Linux 練習 安全加固SELinux

1 啟用 selinux 策略並安裝 httpd 服務,改變 的預設主目錄為 website,新增 selinux 檔案標籤規則,使 可訪問 安裝 httpd 建立 website 及首頁檔案 root localhost mkdir website root localhost echo seli...

mysql安全機制 Mysql安全機制

在mysql下mysql庫中有6個許可權表 mysql.user 使用者字段,許可權字段,安全字段,資源控制字段 mysql.db mysql.host 使用者字段,許可權字段 mysql.tables priv,mysql.columms priv,mysql.procs priv 一 使用者管理...