semanage命令的安裝

支持原創:https://blog.csdn.net/capricorn90/article/details/52577880

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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章