-bash: semanage: command not found

Crime scene:

[root@centos7_server ~]# semanage fcontext -a -t httpd_sys_content_t /httpdd/
-bash: semanage: command not found

Solution:

[root@centos7_client ~]# yum provides semanage
policycoreutils-python-2.5-17.1.el7.x86_64 : SELinux policy core python utilities
Repo : ABC
Matched from:
Filename : /usr/sbin/semanage

 [root@centos7_client ~]# ls -l /cdrom/Packages/ | grep polic*

-rw-rw-r-- 2 root root 456316 Aug 10 2017 policycoreutils-python-2.5-17.1.el7.x86_64.rpm

-rw-rw-r-- 2 root root 172424 Aug 10 2017 policycoreutils-sandbox-2.5-17.1.el7.x86_64.rpm
-rw-rw-r-- 3 root root 446164 Aug 10 2017 selinux-policy-3.13.1-166.el7.noarch.rpm
-rw-rw-r-- 2 root root 1726588 Aug 10 2017 selinux-policy-devel-3.13.1-166.el7.noarch.rpm
-rw-rw-r-- 2 root root 6810796 Aug 10 2017 selinux-policy-minimum-3.13.1-166.el7.noarch.rpm
-rw-rw-r-- 2 root root 5018924 Aug 10 2017 selinux-policy-mls-3.13.1-166.el7.noarch.rpm
-rw-rw-r-- 3 root root 6810996 Aug 10 2017 selinux-policy-targeted-3.13.1-166.el7.noarch.rpm
[root@centos7_client ~]# yum -y install /cdrom/Packages/policycoreutils-python-2.5-17.1.el7.x86_64.rpm

.......

 

[root@centos7_server ~]# semanage fcontext -a -t httpd_sys_content_t /httpdd/
[root@centos7_server ~]# ls -Zd /httpdd/
drwxr-xr-x. root root unconfined_u:object_r:default_t:s0 /httpdd/
[root@centos7_server ~]# semanage fcontext -a -t httpd_sys_content_t /httpdd/*
[root@centos7_server ~]# restorecon -Rv /httpdd/
restorecon reset /httpdd/index.html context unconfined_u:object_r:default_t:s0->unconfined_u:object_r:httpd_sys_content_t:s0
[root@centos7_server ~]#

 

For reference: http://www.igoodgoodstudy.com/2017/03/27/4/

 

The above are two methods recorded when learning Linux. If there are any inaccuracies, please contact below.

 

  E_Mail:[email protected]

 

  QQ:1958344794

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325944574&siteId=291194637