51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

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

概述

由于需要开放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
赞(2)
未经允许不得转载:工具盒子 » Centos通过semanage添加端口时:无法提交 semanage 事务