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

相关推荐

  • LAMP+NFS实现双web服务负载均衡

        一、实验拓扑          二、系统环境      1、主机A、主机B、主机C:CentOS 6.5        测试PC:         Windows 7 旗舰…

    Linux干货 2015-07-06
  • 初窥门径之脚本书写

    一、几个脚本的编写: 1、编写脚本/root/bin/systeminfo.sh,显示当前主机系统信息,包括主机名,IPv4地址,操作系统版本,内核版本,CPU型号,内存大小,硬盘大小。 #!/bin/bash echo "HOSTNAME: $HOSTNAME" echo "IPV4 A…

    Linux干货 2016-08-15
  • 计算机和linux基础

    计算机的组成及其功能 计算机硬件主要由5部分组成:运算器 、控制器、存储器、input、output。 但是这和我们平时见到的计算机不一样?我们平时见到的计算机有CPU,内存,硬盘,显示器,鼠标键盘,显卡、主板等。这些东西也都归在以上五类设备中。下面我们简单介绍一下计算机这五个组成部分。 运算器: 运算器是计算机中做运算的部分,可以执行各种指令,加减乘除,与…

    Linux干货 2016-09-16
  • nginx+keepalived构建负载均衡代理服务器

    实验环境: 1、centos7.3 centos6.82、两台VS提供nginx代理和keepalived3、两台RS提供httpd服务并部署wordpress4、另外一台提供Mysql数据库服务 实验拓扑图: 拓扑图 实验步骤 1、在vs1(172.18.251.4)上配置,用yum安装keepalived和nginx yum install -y kee…

    Linux干货 2017-05-21
  • Bind编译安装详解

    Bind编译安装详解 Bind是一款开放源码的DNS服务器软件,由美国加州大学Berkeley分校开发和维护的,全名为Berkeley Internet Name Domain它是目前世界上使用最为广泛的DNS服务器软件,支持各种unix平台和windows平台。现今互联网上最常使用的DNS服务器软件,使用BIND作为服务器软件的DNS服务器约占所有DNS服…

    Linux干货 2016-07-22
  • 马哥linux0801课程内容

    0801课堂笔记 硬链接和软链接最根本的区别 硬链接是同一个文件,而软链接是两个文件 软链接查询到文件的软链接个数.比较麻烦. 而硬链接的个数可以通过链接数就可以看到. 硬链接不能跨分区,而软链接可以跨分区 (因为每个分区都有自己的inode表) ln 创建硬链接 ln–s 创建软链接(软链接如果使用相对路径,对象是相对软链接的路径,而硬…

    Linux干货 2016-08-04