selinux

[root@localhost ~]# ll /etc/sysconfig/selinux 
lrwxrwxrwx. 1 root root 17 May 10 16:38 /etc/sysconfig/selinux -> ../selinux/config

[root@localhost ~]# cat /etc/selinux/config

This file controls the state of SELinux on the system.

SELINUX= can take one of these three values:

    enforcing – SELinux security policy is enforced.

    permissive – SELinux prints warnings instead of enforcing.

    disabled – No SELinux policy is loaded.

SELINUX=enforcing

SELINUXTYPE= can take one of these two values:

    targeted – Targeted processes are protected,

    mls – Multi Level Security protection.

SELINUXTYPE=targeted 

[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# touch /root/home.txt
[root@localhost ~]# ll /root/home.txt
-rw-r–r–. 1 root root 0 May 15 01:07 /root/home.txt
[root@localhost ~]# ll -Z /root/home.txt
-rw-r–r–. root root unconfined_u:object_r:admin_home_t:s0 /root/home.txt
[root@localhost ~]# chcon -t user_tmp_t /root/home.txt
[root@localhost ~]# ll -X  /root/home.txt
-rw-r–r–. 1 root root 0 May 15 01:07 /root/home.txt
[root@localhost ~]# 

chcon -t httpd_sys_content_t index.html        //81.7

restorecon

getsebool
setsebool

[root@localhost ~]# getsebool -a

[root@localhost ~]#  getsebool ftp_home_dir
ftp_home_dir –> off

[root@localhost ~]# setsebool ftp_home_dir on
[root@localhost ~]#  getsebool ftp_home_dir
ftp_home_dir –> on

[root@localhost ~]# setsebool -P  ftp_home_dir on

root@localhost ~]# file /var/log/audit/audit.log 
/var/log/audit/audit.log: ASCII text, with very long lines

[root@localhost html]# iptables -L -n
[root@localhost html]# iptables -L -n
[root@localhost html]# iptables -L -n

[root@localhost html]# ss -tnl

原创文章,作者:fsy,如若转载,请注明出处:http://www.178linux.com/75854

(0)
fsyfsy
上一篇 2017-05-15 21:01
下一篇 2017-05-15 21:35

相关推荐

  • 马哥教育网络班22期-第2周博客作业2

    2、bash的工作特性之命令状态返回值和命令展开所涉及的内容及其示例演示 bash的基础特性:命令的执行状态结果   命令执行的状态结果:   bash通过状态返回值来输出此结果:     成功:0     失败:1-255  &…

    Linux干货 2016-08-22
  • Mariadb数据库复制系列(四):复制过滤器的实现

       实验四:复制过滤器的实现 复制过滤器的作用是让从节点仅复制主节点的指定的库,或指定数据库的指定表,而不是全部复制。其配置方式有两种,一种是在主节点上配置,通过定义主节点只记录部分库或表产生的二进制日志时间来实现;一种是通过从节点上配置,当复制了主节点的所有的二进制日志数据后,在SQL线程执行时,只执行指定的库或表相关的二进制日志时间;一般采取在从节点上…

    Linux干货 2016-11-24
  • 分区工具fdisk和gdisk、同步分区表(到内存)

    fdisk  创建MBR分区 gdisk  创建GPT分区 parted  高级分区操作(创建、复制、调整大小等)  centos7:手动创建分区20g,30g,40g(易区分) lsblk cat  /proc/partitions ls  -l  /dev/sd* 以上三个命令是查看内…

    2017-06-15
  • N–25期 第九周作业

    1、写一个脚本,判断当前系统上所有用户的shell是否为可登录shell(即用户的shell不是/sbin/nologin);分别这两类用户的个数;通过字符串比较来实现; #!/bin/bash declare -i sumlogin=0 declare -i sumnologin=0 for i …

    Linux干货 2017-03-07
  • 修改Linux命令终端提示符

    作业1. 设置自己的终端提示符,要求字符终端登录时:     a> 需要带颜色     b> 需要显示当前执行到了第几条命令     c> 显示当前登录终端,主机名和当前时间     这可以通…

    Linux干货 2016-10-17
  • 链接分析算法之:HillTop算法

       Hilltop算法是由Krishna Baharat 在2000年左右研究的,于2001年申请专利,但是有很多人以为Hilltop算法是由谷歌研究的。只不过是Krishna Baharat 后来加入了Google成为了一名核心工程师,然后授权给Google使用的。     &nbsp…

    大数据运维 2015-04-08