CWIKIUS

Fedora/REHL 安装 semanage

2022-07-06  本文已影响0人  HoneyMoose

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

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

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

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

检查要安装的包

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

运行下面的命令:

dnfprovides semanage

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

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

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

安装

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

sudodnf install policycoreutils-python-utils

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

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

校验安装

输入命令

semanage-h

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

[fedora@src conf.d]$ semanage -husage: semanage [-h] {import,export,login,user,port,ibpkey,ibendport,interface,module,node,fcontext,boolean,permissive,dontaudit} ...semanageisused to configure certain elements of SELinux policy with-outrequiring modification to or recompilation from policy source.positional arguments:  {import,export,login,user,port,ibpkey,ibendport,interface,module,node,fcontext,boolean,permissive,dontaudit}importImport local customizations    export              Output local customizations    login              Manage login mappings between linux users and SELinux confined users    user                Manage SELinux confined users (Roles and levelsforan SELinux user)    port                Manage network port type definitions    ibpkey              Manage infiniband ibpkey type definitions    ibendport          Manage infiniband end port type definitionsinterfaceManagenetworkinterfacetypedefinitionsmodule              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 rulesinpolicyoptions:  -h, --help            showthishelp message and exit

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

至此,配置已经完成了。

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

上一篇 下一篇

猜你喜欢

热点阅读