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

相关推荐

  • Python基础—内置数据类型

    一、简介              如果你用过C或者C++,你该知道你的许多工作集中在实现数据结构上面。你需要管理内存分配,部署内存结构等等。这些东西比较乏味,通常会让你无法集中在真正想实现的目标上面。    …

    Linux干货 2015-11-10
  • Linux文件权限管理及目录文件的深入理解。

    文件权限及目录 初学Linux,感觉这个东西该复杂,而且逻辑非常的强。难~! 自己根据学习到的理论和实践,得出的对文件权限,进程,以及特殊权限的深入理解。希望能解决初学者对于权限的困惑。如有错误请指正。 文件的权限,指定的是什么? 是文件的权限位上的权限,针对三类用户,任何用户都必须是三类用户中的一种,属主属组和其他人的权限rwx   &…

    Linux干货 2016-08-10
  • CentOS6 ELK实现

    1 简介 我们来介绍Centos6.5基于SSL密码认证部署ELK(Elasticsearch 1.4.4+Logstash 1.4.2+kibana3),同时为大家介绍如何集合如上组件来收集日志,本章的日志收集主要为大家介绍SYSTEM日志收集. 集中化日志收集主要应用场景是在同一个窗口临时性或永久性鉴定分析系统,应用等各类日志,对用户提供极大便…

    Linux干货 2017-05-17
  • vsftpd基于mysql实现用户认证

    一、前言   ftp介绍:     ftp全程是File Transfer Protocol(文件传输协议),方便于实文件交换;但是在文件传输以及账号密码发送时都是以明文传输,因此是一个明文协议 ftp是C/S方式:   常见的客户端有:     GUI方式:browers、FileZilla-cl…

    Linux干货 2015-06-15
  • linux终端变量设置,文件系统,man使用说明,文件类型

    一、定义终端提示符的变量 export PS1=’\e[32m[\e[33m\u\e[31m@\e[35m\h\e[36m\t\e[34m\#\e[31m\s\e[37m\W\e[32m]\$ ‘  `]# export 是个命令      PS1指终端提示符变量    &n…

    Linux干货 2013-06-16
  • Python内置数据结构——集合set

    集合 定义 set翻译为集合 collection翻译为集合类型,是一个较大的概念 set是一个可变的、无序的、不重复的元素组成的集合 set的元素要求必须可以hash,目前已学的不可hash的类型只有list、set 元素不可以索引 set可以迭代 set的初始化 set_1 =set() #表示定义一个空集合set_1 set_1 =set(iterab…

    Linux干货 2017-10-03