semanage命令是用来查询与修改SELinux默认目录的安全上下文
用法:
semanage fcontext [-S store] -{a|d|m|l|n|D} [-frst] file_spec
semanage fcontext [-S store] -{a|d|m|l|n|D} -e replacement target
主要参数:
-a:添加
-d:删除
-m:修改
-l:列举
-n:不打印说明头
-D:全部删除
-f:文件
-s:用户
-t:类型
r:角色
[root@localhost ~]# semanage fcontext -l
# semanage fcontext -a -t public_content_t '/westos(/.*)?'
#-a 表添加;-t 类型,将/westos本身以及目>录中的所有的文件目录的上下文类型添加到永久上下文中
semanage port -a -t ssh_port_t -p tcp 2222 # 添加自定义接口到服务
评论(0)
暂无评论
