1 什麼時selinux
selinux,內核級加強型防火牆
2 如何管理selinux級別
selinux開啓或者關閉)
vim /etc/sysconfig/selinux
selinux=disabled##關閉狀態
selinux=Enforcing##強制狀態
selinux=Permissive##警告狀態
getenforce##查看狀態
當selinux開啓時
setenforce 0|1##更改selinux運行級別
3.如何更改文件安全上下文
臨時更改)
chcon -t 安全上下文文件
chcon -t public_content_t /publicftp -R
永久更改)
semanage fcontext -l##列出內核安全上下文列表內容
semanage fcontext -a -t public_content_t '/publicftp(/.*)?'
restorecon -FvvR /publicftp/
4.如何控制selinux對服務功能的開關
getsebool -a | grep 服務名稱
getsebool -a | grep ftp
setsebool -P 功能bool值 on|off
setsebool -Pftpd_anon_write on
5.監控selinux的錯誤信息
setroubleshoot-server
6.安全上下文
semanage fcontext -a -t public_content_t '/westos(/.*)?'
restorecon -FvvR /westos/
ls -Zdl /westos/