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

相关推荐

  • 内核编译实际效果演示

    内核编译实际操作效果演示     环境:CentOS7.2,自带内核版本为3.10.0-327.el7.x86_64,下载3.18.41版本进行编译     步骤1:确保开发工具包组已安装     [root@localhost …

    Linux干货 2016-09-13
  • 新的篇章

    第一天,linux,努力,奋斗!

    Linux干货 2017-07-11
  • 马哥教育21期网络班—第15周课程+练习

    2、删除/boot/grub/grub.conf文件中所有行的行首的空白字符; sed 's@^[[:space:]]\+@@' /boot/grub/grub.conf 3、删除/etc/fstab文件中所有以#开头,后跟至少一个空白字符的行的行首的#和空白字符; sed 's@^#[[:spac…

    Linux干货 2016-11-14
  • Linux文件管理&bash特性

    Linux上的文件管理命令 目录管理命令: mkdir:make directories mkdir [OPTION]… DIRECTORY… -p: 自动按需创建父目录; -v: verbose,显示详细过程; -m MODE:直接给定权限; 注意:路径基名方为命令的作用对象;基名之前的路径必须得存在; r…

    Linux干货 2016-09-28
  • 马哥教育网络班20期+第2周课程练习

    马哥教育网络班20期+第2周课程练习 练习题: 1、Linux上的文件管理类命令都有哪些,其常用的使用方法及其相关示例演示。2、bash的工作特性之命令执行状态返回值和命令行展开所涉及的内容及其示例演示。3、请使用命令行展开功能来完成以下练习:   (1)、创建/tmp目录下的:a_c, a_d, b_c, b_d  …

    Linux干货 2016-06-23
  • 【LINUX编译安装程序】Centos7.4编译安装httpd 2.4.29

    举例:Centos7.4编译安装httpd 2.4.29

    Linux干货 2018-03-17