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

相关推荐

  • rsyslog+mysql+loganalyzer 搭建日志服务器及监控

    rsyslog 日志:历史事件; 历史事件:时间、地点、事件; syslog: klogd:kernel yslogd:system(application) 事件记录格式:日期时间 主机 进程[pid]:事件内容; C/S架构;通tcp或udp协议的服务完成日志记录的传送; rsyslog: rsyslog的特性: – 多线程; –…

    Linux干货 2017-01-10
  • Linux启动流程

    内核级别: 1、POST开机加电自检 BIOS加载CMOS信息并进行开机自检,检测硬件设备是否正常并进行硬件设备初始化 2、Boot Sequence(BIOS):定义设备启动顺序 BIOS定义设备启动顺序,并读取启动设备数据加载硬盘上的第一个扇区MBR。 3、Boot Loader(MBR):bootloader功能实现 Boot Loader提供一个菜单…

    Linux干货 2016-11-23
  • HA之corosync+pacemaker+crmsh

    高可用集群框架 图片转载之http://www.178linux.com/16656 实验拓扑: 两台节点服务器: node1     192.168.150.137     node1.com node2     192.168.150.138     node2.com nf…

    Linux干货 2017-01-18
  • DNS配置

     DNS配置 基本的配置准备 1.安装bind 2.开启named服务 一、正向解析库 1、修改/etc/named.conf配置文件 vim /etc/named.conf 修改如下行 listen-on port 53 { 10.1.44.2; } allow-query     { any; } recursion no;…

    Linux干货 2016-10-09
  • Linux 6.8系统安装操作过程

      首先按照好vmware 虚拟机,安装过程忽略。       虚拟机新建完毕后,在虚拟机设置框中,选择硬件cd/dvd,右侧勾选使用iso磁盘文件,点击浏览,选择所需镜像文件,点击确定按钮。      然后,单击启动虚拟机   &nbsp…

    2017-05-21