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
下一篇 2017-05-15

相关推荐

  • rpm程序包管理器使用详解

    rpm程序包管理器的使用详解   说到程序包管理器,就会想到基于CentOS系统上的rpm命令与其对应的前端处理器yum。所谓程序包,是将源代码转换为二进制格式,再组织成一个或者多个包文件供用户安装使用。rpm程序包的命名格式如下:   name-VERSION-release.arch.rpm   软件名-版本号(分为主版本m…

    Linux干货 2016-08-21
  • BIND在生产环境中的创建

    一、实验:BIND二级域的搭建(均以yum安装bind),从实验图中可以看出需要五台虚拟机进行测试 一、准备五台虚拟机 二、配置root服务器 1、YUM安装bind的程序 2、配置bind的主配置文件 3、配置区域文件 4、为了实验的方便进行,把防火墙和SElinux关闭,并留意区域文件的属主属组 5、检查named的主配置文件和区域文件是否语法错误,并启…

    Linux干货 2016-10-05
  • 马哥教育网络班28期—第1、2天知识点概略

    没做随堂笔记,根据记忆手打,看看自己能记住多少。

    Linux干货 2017-12-03
  • 第一天课程内容

    一 连接VNC 主机名:172.20.0.100 二 课堂资源下载 ftp://172.16.0.1 三 博客作业     优秀示例 www.yulongjun.com     博客地址 www.178linux.com     作业要求 1.每周一篇或更多,整理当周内容。 2.老师周五发链接地址,提交博客链接。 四 职业发展线路 运维 > Pytho…

    Linux干货 2018-03-26
  • Linux Sysadmin–part2

    1、写一个脚本,使用ping命令探测192.168.4.1-192.168.4.254之间的所有主机的在线状态; 在线的主机使用绿色显示; 不在线的主使用红色显示; #!/bin/bash #description: #date: #Author: for i in {1..254}; do if ping -c 3 192.168.4.$i &&g…

    2017-09-19
  • 马哥教育网络班22期+第6周课程练习

    week6: 请详细总结vim编辑器的使用并完成以下练习题 vim编辑器小结: 1. vim编辑器的模式: vim编辑器有很多模式,常用模式有:Normal,Insert,Command; 通常,打开一个文件,此时所处的就是normal模式;normal模式下可以浏览,修改文件内容; 在任何模式下,只要按ESC就可以返回到Normal模式; Ins…

    Linux干货 2016-09-26