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)
上一篇 2017-05-15 21:01
下一篇 2017-05-15 21:35

相关推荐

  • linux终端类型

    终端分为:             ∟  物理终端         定义:可将显示器,键盘,鼠标直接接入主机接口的终端;     &nbsp…

    Linux干货 2016-10-18
  • linux任务管理与计划

    linux系统作业控制的命令:     job(作业):一个作业通常包含多个命令(也有可能只包含一个),联合起来由单个小程序组合,完成复杂任务,对Linux而言作业有两种;前台作业和后台作业        前台作业(forgroud):通过终端启动,且启动后会…

    Linux干货 2016-09-13
  • python基础 习题总结

    pyenv 编程题目总结(99乘法表 打印菱形与闪电 斐波那契数列 素数 猴子吃桃) 原反补码与异或运算 list列表

    Linux干货 2018-03-25
  • Linux 系统启动流程及bash 脚本编程练习

    马哥教育网络班23期 第10周课堂练习 Linux 系统启动流程及bash 脚本编程练习1、请详细描述CentOS系统的启动流程(详细到每个过程系统做了哪些事情) 2、为运行于虚拟机上的CentOS 6添加一块新硬件,提供两个主分区; (1)为硬盘新建两个主分区;并为其安装grub; (2)为硬盘的第一个主分区提供内核和ramdisk文件;为第二个分区提供r…

    Linux干货 2017-01-23
  • Bash基础命令操作

    Bash基础命令操作

    2018-03-18
  • 磁盘管理(SWAP、dd、quota、RAID、LVM)

    2016-08-26: 授课内容: 1、SWAP交换分区的创建 2、dd命令的使用 3、设定文件系统配额 4、设定和管理软RAID设备 5、配置逻辑卷、逻辑卷快照 1、swap (1)SWAP分区:模拟内存,当物理内存不足时,进程需要内存资源是,内存会把一部分没有在用的进程分页挪到硬盘的模拟内存中,腾出空间被现在需要使用内存资源的进程 即其作用是可以允许内存…

    Linux干货 2016-09-01