zoukankan      html  css  js  c++  java
  • -bash: semanage: command not found

    案发现场:

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

    解决方法:

    [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 ~]#

    供参考:http://www.igoodgoodstudy.com/2017/03/27/4/

    以上,便是在下学习Linux的时候记录下来两种方法。 如有不正之处,请联系在下。

      E_Mail:Daniu2015@sina.cn

      QQ:1958344794

    刚入们的超级小白,学习过程当中记录一些异常信息及解决方法。 欢迎大家一起交流。
  • 相关阅读:
    win7最新版下载与密钥 | Win7用户福音:微软集成更新的新版Windows 7镜像泄露
    迅捷PDF编辑器 v2.1.0.1 中文免费版
    解决移动网络无法访问胡萝卜周网站(www.carrotchou.blog)
    vue启动流程
    vue--综合组件间的通信
    网络请求
    vue环境搭建
    vue--路由嵌套
    vue路由高级用法
    vue-router实现组件间的跳转---参数传递
  • 原文地址:https://www.cnblogs.com/JiangDameiniu/p/9012653.html
Copyright © 2011-2022 走看看