semanage命令的安装 | 您所在的位置:网站首页 › linux查看selinux工具是否安装 › semanage命令的安装 |
实验环境:CentOS 7 Minimal Installation 64bit(1511) semanage命令是用来查询与修改SELinux默认目录的安全上下文。命令介绍这里推荐最为完整的在线中文版man手册 http://man.linuxde.net/semanage CentOS系统自带的chcon工具只能修改文件、目录等的文件类型和策略,无法对端口、消息接口和网络接口等进行管理,semanage能有效胜任SELinux的相关配置工作。 [root@localhost ~]# semanage -bash: semanage: command not found [root@localhost ~]# yum install semanage Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * extras: mirrors.btte.net * updates: mirrors.btte.net No package semanage available. Error: Nothing to do [root@localhost ~]# yum provides semanage Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * extras: mirrors.btte.net * updates: mirrors.btte.net policycoreutils-python-2.2.5-20.el7.x86_64 : SELinux policy core python utilities Repo : base Matched from: Filename : /usr/sbin/semanage 安装,这里直接使用tab键补全功能可以方便的找到要安装的包。tab补全功能参考http://blog.csdn.net/capricorn90/article/details/52558280 [root@localhost ~]# yum -y install policycoreutils-python.x86_64 命令常用格式 #管理登录linux的用户和SELinux局限的用户之间的映射 semanage login [-S store] -{a|d|m|l|n|D} [-sr] login_name | %groupname #管理策略模块 semanage module [-S store] -{a|d|l} [-m [–enable | –disable] ] module_name 管理网络端口类型定义 semanage port [-S store] -{a|d|m|l|n|D} [-tr] [-p proto] port | port_range |
CopyRight 2018-2019 实验室设备网 版权所有 |