SELinux(Security-Enhanced Linux) 是美國國家安全域(NSA)對于強制訪問控制的實作,是 Linux歷史上最杰出的新安全子系統
使用命令的時候發現:
getsebool -a | grep ftp
出現以下資訊:
[root@VM-0-9-centos ~]# getsebool -a | grep ftp
getsebool: SELinux is disabled
解決辦法是修改/etc/selinux/config組態檔:
vi /etc/selinux/config
強制模式SELINUX=enforcing:表示所有違反安全策略的行為都將被禁止,
寬容模式SELINUX=permissive:表示所有違反安全策略的行為不被禁止,但是會在日志中作記錄
# 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.
#默認是disabled,需要更改為permissive
SELINUX=permissive
# 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
但一個坑來了,我修改了執行命令,還是顯示getsebool: SELinux is disabled
解決辦法:
修改config檔案后,需要重啟實體,但直接重啟實體將會出現系統無法啟動的錯誤,因此在重啟之前需要在根目錄下新建autorelabel檔案,
touch /.autorelabel
shutdown -r now
最后執行命令,成功執行:
[root@VM-0-9-centos ~]# getsebool -a | grep ftp
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> off
ftpd_full_access --> off
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
httpd_can_connect_ftp --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_home_dir --> off
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/206531.html
標籤:其他
上一篇:綜合專案:lvs+keepalived+glusterfs群集
下一篇:linux安裝nginx填坑教程
