SELinux: Could not downgrade policy file
在配置nfs服务器,设定selinux时,碰到了SELinux: Could not downgrade policy file的错误提示,下文是其解决方案。
一、故障现象
[root@system1 ~]# semanage fcontext -a -t 'public_content_t' '/protected(/.*)?'
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.29, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.29: No such file or directory
/sbin/load_policy: Can't load policy: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2.
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.29, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.29: No such file or directory
/sbin/load_policy: Can't load policy: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2.
ValueError: Could not commit semanage transaction
二、解决方案
从故障的提示来看,说不能够降级策略文件,以及找不到policy.29这个文件 [root@system1 ~]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[root@system1 ~]# uname -r
3.10.0-123.el7.x86_64 ###下面查看selinux配置,如下,为disabled状态 [root@system1 ~]# sestatus
SELinux status: disabled [root@system1 ~]# getenforce
Disabled [root@system1 ~]# rpm -q libsepol libsemanage libselinux
libsepol-2.1.9-3.el7.x86_64
libsemanage-2.1.10-16.el7.x86_64
libselinux-2.2.2-6.el7.x86_64 ### 临时修改selinux 配置
[root@system1 ~]# setenforce 1 ###尝试设置为1,依旧提示关闭
setenforce: SELinux is disabled [root@system1 ~]# getenforce
Disabled ### 查看enforce配置文件
[root@system1 ~]# more /etc/sysconfig/selinux # 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=permissive
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted ### 手工修改配置文件 [root@system1 ~]# vi /etc/sysconfig/selinux SELINUX=enforce [root@system1 ~]# getenforce ###依旧为关闭
Disabled ###不知道什么原因导致配置修改无法生效,于是尝试重启Linux [root@system1 ~]# reboot ### 再次修改和执行都OK
[root@system1 ~]# getenforce
Permissive
[root@system1 ~]#
[root@system1 ~]#
[root@system1 ~]# setenforce 1
[root@system1 ~]#
[root@system1 ~]# getenforce
Enforcing ### 再次执行semanage成功
[root@system1 ~]# semanage fcontext -a -t 'public_content_t' '/protected(/.*)?'
[root@system1 ~]#
SELinux: Could not downgrade policy file的更多相关文章
- 使用 SecurityManager 和 Policy File 管理 Java 程序的权限
参考资料 该文中的内容来源于 Oracle 的官方文档.Oracle 在 Java 方面的文档是非常完善的.对 Java 8 感兴趣的朋友,可以从这个总入口 Java SE 8 Documentati ...
- flash as3 socket安全服务网关(socket policy file server)
关键字: SecurityErrorEvent socket as3 flash有着自己的一套安全处理模式,在socket方面,我这样的菜鸟无法理解他的好处:一句话,不怀好意的人如果想用flash写一 ...
- 如何查看,关闭和开启selinux
以下介绍一下SELinux相关的工具/usr/bin/setenforce 修改SELinux的实时运行模式setenforce 1 设置SELinux 成为enforcing模式setenforce ...
- Linux下禁用、启用SeLinux
一些Linux默认都是启用SeLinux的,在安装操作系统的时候我们可以选择开启或者关闭SeLinux,但是在安装完系统之后又如何开启与关闭呢? 在/etc/sysconf下有一个SeLinux文件, ...
- [转]SELinux管理与配置
原文链接:http://blog.csdn.net/huangbiao86/article/details/6641893 1.1 SElinux概述 SELinux(Security-Enhance ...
- RH253读书笔记(5)-Lab 5 Network File Sharing Services
Lab 5 Network File Sharing Services Goal: Share file or printer resources with FTP, NFS and Samba Se ...
- Linux学习-SELinux 初探
什么是 SELinux 什么是 SELinux 呢?其实他是『 Security Enhanced Linux 』的缩写,字面上的意义就是安全强化的 Linux 之意! 当初设计的目标:避免资源的误用 ...
- Linux SELinux 使用操作
Linux SELinux 使用操作 # 修改 SELinux 启动模式.临时生效 命令:setenforce [0|1] 0:转成 permissive 宽容模式: 1:转成 Enforcing 强 ...
- SELinux 和 iptables 开启关闭
SELinux 是 2.6 版本的 Linux 内核中提供的强制访问控制(MAC)系统.对于目前可用的 Linux安全模块来说,SELinux 是功能最全面,而且测试最充分的,它是在 20 年的 MA ...
随机推荐
- Struts framework
Struts功能详解——ActionMapping对象 Struts旅程(一)Struts简介和原理 实例讲解DispatchAction和LookupDispatchAction DispatchA ...
- [LeetCode] Evaluate Reverse Polish Notation [2]
题目 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, ...
- php手册常用的函数
<?php ************************************************************/ header("Content-type:tex ...
- StatusBar用法
一.StatusBar组件介绍 StatusBar 是 React Native 0.20 起新增的跨平台组件,它可以用来设置并动态改变设备的状态栏显示特性. StatusBar 组件可以同时加载多个 ...
- MUI - sortable在mui.js前端框架不兼容的解决方案
关于sortable看这 兼容的解决方案看这 http://www.cnblogs.com/phillyx/ 示例代码已更到github
- 微信小程序云数据库——where查询和doc查询区别
用法 条件查询where 我们也可以一次性获取多条记录.通过调用集合上的 where 方法可以指定查询条件,再调用 get 方法即可只返回满足指定查询条件的记录,比如获取用户的所有未完成的待办事项,用 ...
- [转]embedding technic:从SNE到t-SNE再到LargeVis
http://bindog.github.io/blog/2016/06/04/from-sne-to-tsne-to-largevis/#top
- 微服务开源生态报告 No.2
通常,我们都会通过在 GitHub 上订阅邮件列表,来了解社区动态.这一次,我们联合以上各开源项目的负责人,发布「微服务开源生态报告」,汇集各个开源项目近期的社区动态,帮助开发者们更高效的了解到各开源 ...
- Nacos 发布 1.0.0 GA 版本,可大规模投入到生产环境
经过 3 个 RC 版本的社区体验之后,Nacos 正式发布 1.0.0 GA 版本,在架构.功能和 API 设计上进行了全方位的重构和升级. 1.0.0 版本的发布标志着 Nacos 已经可以大规模 ...
- @游记@ CSP2019
目录 @day -??@ @day -1@ @day 0@ @day 1@ @day 2@ @day ??@ @day ??+1@ @day -??@ 和 yhn 学长在校外偶遇. 聊了一些.他说现在 ...