前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Fedora/REHL 安装 semanage

Fedora/REHL 安装 semanage

原创
作者头像
HoneyMoose
发布2022-07-06 05:18:03
3000
发布2022-07-06 05:18:03
举报
文章被收录于专栏:CWIKIUSCWIKIUS

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

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

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

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

检查要安装的包

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

运行下面的命令:

代码语言:javascript
复制
dnf provides semanage

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

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

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

Snag_1e212ec4
Snag_1e212ec4

安装

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

代码语言:javascript
复制
sudo dnf install policycoreutils-python-utils

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

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

校验安装

输入命令

代码语言:javascript
复制
semanage -h

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

代码语言:javascript
复制
[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

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

Snag_1e26c33c
Snag_1e26c33c

至此,配置已经完成了。

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

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 检查要安装的包
  • 安装
  • 校验安装
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档