• -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

    刚入们的超级小白,学习过程当中记录一些异常信息及解决方法。 欢迎大家一起交流。
  • 相关阅读:
    目标检测的图像特征提取之(一)HOG特征
    压缩跟踪Compressive Tracking
    计算机视觉领域的一些牛人博客,研究机构等的网站链接
    运动检测(前景检测)之(二)混合高斯模型GMM
    最简单的目标跟踪(模版匹配)
    Kalman滤波器从原理到实现
    前景目标检测(总结)
    ViBe(Visual Background extractor)背景建模或前景检测
    paramiko不能通过cd改变路径分析
    SecureCRT SSH主机秘钥配置文件管理
  • 原文地址:https://www.cnblogs.com/JiangDameiniu/p/9012653.html
Copyright © 2020-2023  润新知