Semanage命令不存在的问题:(selinux)

Semanage命令不存在的问题:

semanage命令是用来查询与修改SELinux默认目录的安全上下文。命令介绍这里推荐最为完整的在线中文版man手册 CentOS系统自带的chcon工具只能修改文件、目录等的文件类型和策略,无法对端口、消息接口和网络接口等进行管理,semanage能有效胜任SELinux的相关配置工作。

[root@localhost samba]# semanage fcontext -a -t samba_share_t /home/sambaShare -bash: semanage: command not found

1.当我们使用yum安装的时候它是仓库里面没有的。 [root@localhost samba]# yum install semanage Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile

    base: extras: updates: No package semanage available. Error: Nothing to do 2.执行命令安装第一个包: [root@localhost samba]# yum provides semanage 3.安装第二个包: [root@localhost samba]# yum -y install policycoreutils-python.x86_64 完成 4.执行我们需要的命令它成功了 [root@localhost samba]# semanage fcontext -a -t samba_share_t /home/sambaShare [root@localhost samba]#
经验分享 程序员 微信小程序 职场和发展