ITPub博客

首页 > Linux操作系统 > Linux操作系统 > selinux常用命令

selinux常用命令

原创 Linux操作系统 作者:tonykorn97 时间:2008-11-26 14:25:08 0 删除 编辑

1,查看安全上下文
ls -Z
ps -Z

2,更改安全上下文
chcon -t tmp_t /etc/hosts
chcon -t public_content_rw_t /var/ftp/incoming

[@more@]

3,恢复系统的默认上下文
restorecon /etc/hosts

4,查看和设置selinux级别
getenforce
setenforce
system-config-selinux

5,selinux帮助工具
安装setroubleshootd
用sealert -b打开这个图形工具

6,selinux策略管理工具
列出文件上下文
semanage fcontext -l | grep ftp


7,setroubleshoot client tool
查看警告id
sealert -l 05d2769e-af58-4fc5-ac09-b32cdfb38222

8,设置SELinux布尔值
setsebool -P ftpd_disable_trans=1
setsebool -P allow_ftpd_anon_write=1

9,get SELinux boolean value(s)
getsebool -a | grep ftp

10,查看程序相关的selinux帮助
[root@station10 vsftpd]# man -k ftp | grep selinux
ftpd_selinux (8) - Security Enhanced Linux Policy for the ftp daemon

[root@station12 /]# man ftpd_selinux

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/312079/viewspace-1013861/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-05

  • 博文量
    1854
  • 访问量
    2088311