×

semanage命令的安装

hqy hqy 发表于2019-05-13 12:39:25 浏览2197 评论0

抢沙发发表评论

实验环境: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} [-t

--------------------- 

作者:capricorn90 

来源:CSDN 

原文:https://blog.csdn.net/capricorn90/article/details/52577880 

版权声明:本文为博主原创文章,转载请附上博文链接!


 您阅读本篇文章共花了: 

打赏

本文链接:https://kinber.cn/post/699.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

群贤毕至

访客