查看: 82|回复: 0

Fedora/REHL 安装 semanage

[复制链接]

4

主题

0

回帖

0

积分

热心网友

金币
0
阅读权限
220
精华
0
威望
0
贡献
0
在线时间
0 小时
注册时间
2009-1-14
发表于 2022-7-6 04:05:00 | 显示全部楼层 |阅读模式

Semanage是 用于配置SELinux策略某些元素而无需修改或重新编译策略源的工具。

这包括将Linux用户名映射到SELinux 用户身份以及对象(如网络端口,接口和主机)的安全上下文映射。

Semanage是 用于配置SELinux 策略某些元素而无需修改或重新编译策略源的工具。

如果没有 Semanage,你要对 SELinux 配置的话就比较麻烦,但是 SELinux 又是现在 Linux 的标配了,所以这个包也就变得很重要了。

检查要安装的包

有时候,你可能不知道要安装的包是什么。

运行下面的命令:

dnf provides semanage

然后你可以看到下面的输出,在下面的输出中,你会看到一个名为:

policycoreutils-python-utils-3.2-1.fc34.noarch 的包名称以及版本号。

在安装的时候是不需要提供版本号的。

 

 

安装

当你找到包的名称后,运行命令:

sudo dnf install policycoreutils-python-utils

就可以了,在这里你不需要提供版本号。

dnf 会自动帮你安装最新的包。

校验安装

输入命令

semanage -h

如果你能够看到下面的输出的话,就说明你的安装已经成功了。

[fedora@src conf.d]$ semanage -h
usage: semanage [-h] {import,export,login,user,port,ibpkey,ibendport,interface,module,node,fcontext,boolean,permissive,dontaudit} ...

semanage is used to configure certain elements of SELinux policy with-out requiring modification to or recompilation from policy source.

positional arguments:
  {import,export,login,user,port,ibpkey,ibendport,interface,module,node,fcontext,boolean,permissive,dontaudit}
    import              Import local customizations
    export              Output local customizations
    login               Manage login mappings between linux users and SELinux confined users
    user                Manage SELinux confined users (Roles and levels for an SELinux user)
    port                Manage network port type definitions
    ibpkey              Manage infiniband ibpkey type definitions
    ibendport           Manage infiniband end port type definitions
    interface           Manage network interface type definitions
    module              Manage SELinux policy modules
    node                Manage network node type definitions
    fcontext            Manage file context mapping definitions
    boolean             Manage booleans to selectively enable functionality
    permissive          Manage process type enforcement mode
    dontaudit           Disable/Enable dontaudit rules in policy

options:
  -h, --help            show this help message and exit

上面提供了这个命令可以使用的帮助。

 

 

至此,配置已经完成了。

https://www.ossez.com/t/fedora-semanage/14028



来源:https://www.cnblogs.com/huyuchengus/p/16449277.html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部