getsebool: SELinux is disabled

SELinux(Security-Enhanced Linux) 是美国国家安全局(NSA)对于强制访问控制的实现,是 Linux历史上最杰出的新安全子系统
在Linux2.6以上作为安全模块,捆绑在发行版中。但是SELinux对Linux中运行的程序监管比较严格,旦SELinux配置复杂,且容易与其他程序产生冲突,所以建议关闭

使用命令的时候发现:

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:表示所有违反安全策略的行为不被禁止,但是会在日志中作记录
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.
#默认是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
  • 13
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 19
    评论
评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值