文档章节

[Centos] 安装 semanage

鱼北子
 鱼北子
发布于 2012/08/27 16:02
字数 794
阅读 283
收藏 0

'm trying to use semanage command to configure certain elements of SELinux policy without requiring modification to or recompilation from policy sources under RHEL 6 server. But, I'm not able to find out this command and/or package name. How do I install semanage command under RedHat Enterprise Linux?

You need to use the yum command to find out which package provides file called /usr/sbin/semanage. Type the following command:
# yum provides /usr/sbin/semanage
OR
# yum whatprovides /usr/sbin/semanage
Sample outputs:

Loaded plugins: rhnplugin
policycoreutils-python-2.0.83-19.8.el6_0.x86_64 : SELinux policy core python utilities
Repo        : rhel-x86_64-server-6
Matched from:
Filename    : /usr/sbin/semanage
policycoreutils-python-2.0.83-19.1.el6.x86_64 : SELinux policy core python utilities
Repo        : rhel-x86_64-server-6
Matched from:
Filename    : /usr/sbin/semanage

Type the following command to install the same, enter:
# yum -y install policycoreutils-python
Sample outputs:

=============================================================================================================================================================================================================================================
Installing:
 policycoreutils-python                                         x86_64                                         2.0.83-19.8.el6_0                                          rhel-x86_64-server-6                                         334 k
Installing for dependencies:
 audit-libs-python                                              x86_64                                         2.0.4-1.el6                                                rhel-x86_64-server-6                                          56 k
 libselinux-python                                              x86_64                                         2.0.94-2.el6                                               rhel-x86_64-server-6                                         201 k
 libsemanage-python                                             x86_64                                         2.0.43-4.el6                                               rhel-x86_64-server-6                                          81 k
 setools-libs                                                   x86_64                                         3.3.7-4.el6                                                rhel-x86_64-server-6                                         400 k
 setools-libs-python                                            x86_64                                         3.3.7-4.el6                                                rhel-x86_64-server-6                                         222 k
Transaction Summary
=============================================================================================================================================================================================================================================
Install       6 Package(s)
Upgrade       0 Package(s)
Total download size: 1.3 M
Installed size: 0
Is this ok [y/N]: y
Downloading Packages:
(1/6): audit-libs-python-2.0.4-1.el6.x86_64.rpm                                                                                                                                                                       |  56 kB     00:00
(2/6): libselinux-python-2.0.94-2.el6.x86_64.rpm                                                                                                                                                                      | 201 kB     00:00
(3/6): libsemanage-python-2.0.43-4.el6.x86_64.rpm                                                                                                                                                                     |  81 kB     00:00
(4/6): policycoreutils-python-2.0.83-19.8.el6_0.x86_64.rpm                                                                                                                                                            | 334 kB     00:00
(5/6): setools-libs-3.3.7-4.el6.x86_64.rpm                                                                                                                                                                            | 400 kB     00:00
(6/6): setools-libs-python-3.3.7-4.el6.x86_64.rpm                                                                                                                                                                     | 222 kB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                        1.7 MB/s | 1.3 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : setools-libs-3.3.7-4.el6.x86_64                                                                                                                                                                                       1/6
  Installing     : setools-libs-python-3.3.7-4.el6.x86_64                                                                                                                                                                                2/6
  Installing     : libsemanage-python-2.0.43-4.el6.x86_64                                                                                                                                                                                3/6
  Installing     : audit-libs-python-2.0.4-1.el6.x86_64                                                                                                                                                                                  4/6
  Installing     : libselinux-python-2.0.94-2.el6.x86_64                                                                                                                                                                                 5/6
  Installing     : policycoreutils-python-2.0.83-19.8.el6_0.x86_64                                                                                                                                                                       6/6
Installed:
  policycoreutils-python.x86_64 0:2.0.83-19.8.el6_0
Dependency Installed:
  audit-libs-python.x86_64 0:2.0.4-1.el6         libselinux-python.x86_64 0:2.0.94-2.el6         libsemanage-python.x86_64 0:2.0.43-4.el6         setools-libs.x86_64 0:3.3.7-4.el6         setools-libs-python.x86_64 0:3.3.7-4.el6
Complete!

Now you can use semanage command:
# semanage
Sample outputs:

/usr/sbin/semanage:
semanage [ -S store ] -i [ input_file | - ]
semanage [ -S store ] -o [ output_file | - ]
semanage {boolean|login|user|port|interface|module|node|fcontext} -{l|D|E} [-n]
semanage login -{a|d|m} [-sr] login_name | %groupname
semanage user -{a|d|m} [-LrRP] selinux_name
semanage port -{a|d|m} [-tr] [ -p proto ] port | port_range
semanage interface -{a|d|m} [-tr] interface_spec
semanage module -{a|d|m} [--enable|--disable] module
semanage node -{a|d|m} [-tr] [ -p protocol ] [-M netmask] addr
semanage fcontext -{a|d|m} [-efrst] file_spec
semanage boolean -{d|m} [--on|--off|-1|-0] -F boolean | boolean_file
semanage permissive -{d|a|l} type
semanage dontaudit [ on | off ]
Primary Options:
	-a, --add        Add a OBJECT record NAME
	-d, --delete     Delete a OBJECT record NAME
	-m, --modify     Modify a OBJECT record NAME
        -i, --input      Input multiple semange commands in a transaction
        -o, --output     Output current customizations as semange commands
	-l, --list       List the OBJECTS
	-E, --extract    extract customizable commands
	-C, --locallist  List OBJECTS local customizations
	-D, --deleteall  Remove all OBJECTS local customizations
	-h, --help       Display this message
	-n, --noheading  Do not print heading when listing OBJECTS
        -S, --store      Select and alternate SELinux store to manage
Object-specific Options (see above):
	-f, --ftype      File Type of OBJECT
		"" (all files)
		-- (regular file)
		-d (directory)
		-c (character device)
		-b (block device)
		-s (socket)
		-l (symbolic link)
		-p (named pipe)
        -F, --file       Treat target as an input file for command, change multiple settings
	-p, --proto      Port protocol (tcp or udp) or internet protocol version of node (ipv4 or ipv6)
	-M, --mask       Netmask
        -e, --equal      Substitue source path for dest path when labeling
	-P, --prefix     Prefix for home directory labeling
	-L, --level      Default SELinux Level (MLS/MCS Systems only)
	-R, --roles      SELinux Roles (ex: "sysadm_r staff_r")
	-s, --seuser     SELinux User Name
	-t, --type       SELinux Type for the object
	-r, --range      MLS/MCS Security Range (MLS/MCS Systems only)
        --enable         Enable a module
        --disable        Disable a module
Requires 2 or more arguments

See also:

You can also view the manual page on semanage using the following command:
$ man semanage

本文转载自:http://zhb1208.iteye.com/blog/1432957

鱼北子

鱼北子

粉丝 23
博文 39
码字总数 7139
作品 0
昌平
技术主管
私信 提问
CentOS SVN Server搭建

操作系统:CentOS-6.3-x86_64-minimal.iso 安装指南:http://wiki.centos.org/zh/HowTos/Subversion 1)出现forbidden 修改svn-auth-conf和svn-acl-conf权限 2)semanage SELinux Command No......

hzyu
2013/05/13
370
0
centos 7 yum 安装mongodb3.6(卸载)

centos 7 yum 安装mongodb3.6(卸载) 2018年03月05日 15:58:20 阅读数:2653 yum下载安装好mongodb3.6之后,切记把mongodb-org-3.6.repo文件删掉或重命名,否则yum之后下载其他东西都会失败...

linjin200
2018/07/02
37
0
升级Python后yum不可用的解决方案

升级Python后yum不可用的解决方案 在Centos官网上查到了一篇文档,方法如下。 首先找到你安装Centos的光盘或者ISO文件,只要系统版本一样即可。拷贝如下文件到系统某目录中: python-2.6.6-3...

lysweb
2017/04/28
0
0
Centos7开通端口方法

以8000端口为例 第一: 防火墙打开对应端口 firewall-cmd --zone=public --add-port=8000/tcp --permanent 重启服务: firewall-cmd --reload 查看结果: firewall-cmd --list-all 第二:...

jackblues
2016/07/25
244
0
关于Centos7添加SSH端口

1、修改SSH配置文件 将#Port 22这一行的#号删除,回车在下一行添加“Port 端口号”(这里留下22端口,不急着删,万一后面设置不成功,远程连不上就尴尬了,毕竟我的是云主机。)2、将selinux...

DEAST
2017/12/29
0
0

没有更多内容

加载失败,请刷新页面

加载更多

SQL性能优化

SQL性能优化 一、SQL的执行顺序 顺序:FROM——ON——JOIN——WHERE——GROUP BY——SUM、COUNT——HAVING——SELECT——DISTINCT——ORDER BY——LIMIT 与写SQL的顺序不同,SQL的执行顺序并...

一字见心
1分钟前
0
0
x001-版本介绍

python版本介绍 目前有2 和 3 有很多企业用的代码是2版本,随着技术的发展,以后用3的会成为大趋势 python3的安装 yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-d...

侠客行之石头
4分钟前
0
0
聊聊rocketmq的TransientStorePool

序 本文主要研究一下rocketmq的TransientStorePool TransientStorePool rocketmq-all-4.6.0-source-release/store/src/main/java/org/apache/rocketmq/store/TransientStorePool.java publi......

go4it
昨天
5
0
笔记

场外借贷, 质押 ,托管, 永续合约. 场外借贷,n签合同. 新功能 证券交易组负责中信证券机构及个人投资交易相关系统,服务机构及个人投资客户, 涉及到两融、期权、 期货、做市等境内境外创新业...

MtrS
昨天
5
0
Pycharm最新激活码2019----亲测可用

今天来讲解下pycharm的激活码使用 其实非常简单 把激活码填入下面的地方即可。如果不知道在哪里,那么就选菜单栏里的help再选Register就会弹出下面的界面 激活码网址里面有 lookdiv.com 里面...

chenhongjiang
昨天
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部