概述

由于需要开放telnet非默认端口,添加SElinux规则时报错。

[root@localhost ~]# semanage port -a -t telnetd_port_t -p tcp 23023
SELinux:  Could not downgrade policy file /etc/selinux/targeted/policy/policy.24, searching for an older version.
SELinux:  Could not open policy file <= /etc/selinux/targeted/policy/policy.24:  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.24, searching for an older version.
SELinux:  Could not open policy file <= /etc/selinux/targeted/policy/policy.24:  No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2.
/usr/sbin/semanage: 无法提交 semanage 事务

处理办法

由于semanage命令添加操作是需要SElinux处于开启状态,在关闭状态是无法进行操作的。

[root@localhost ~]# sestatus
SELinux status:                 disabled
[root@localhost ~]# getenforce
Disabled
# 部分文件位置:/etc/sysconfig/selinux
[root@localhost ~]# sudo vi /etc/selinux/config
SELINUX=enforcing
END

本文标题:Centos通过semanage添加端口时:无法提交 semanage 事务

本文作者:宇宙最帅的男人

本文链接:https://lolicp.com/linux/202112326.html

版权声明:转载或者引用本文内容请注明来源及原作者,本文著作权归作者 (宇宙最帅的男人) 所有。

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

最后修改:2021 年 11 月 12 日
如果觉得我的文章对你有用,请随意赞赏