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

相关推荐

  • httpd功能配置之虚拟主机

       apache默认使用80端口提供服务,使用主服务器配置的话,一台物理机只能提供一个站点服务;可以使用虚拟主机方式提供不同的访问,以实现一台主机提供多站点服务。    虚拟主机的实现方式有三种:基于端口、基于IP、基于主机名。    一、基于端口的虚拟主机     &nbsp…

    Linux干货 2016-03-12
  • CentOS 6启动过程总结与GRUB问题修复

    一、CentOS 6 的启动流程 第一步:加电自检(POST) 主要检查硬件设备是否存在并能正常运行,如:CPU、内存、硬盘、风扇、输入输出设备等。自检功能主要是通过BIOS来实现的,BIOS程序是装载在一个硬件芯片CMOS上的,加电过程就是给CMOS通电,然后启动BIOS程序,BIOS程序会根据CMOS上面的一些配置信息区读取其他的硬件设备信息并检测其是否…

    Linux干货 2016-09-16
  • DHCP服务

    一、DHCP概述     DHCP全称为Dynamic Host Configuration Protocol,即动态主机配置协议,其主要作用是使用网内的主机可以自动获取到网络相关参数信息,以达到高效管理主机的目的。     DHCP采用C/S架构,即Server/Client。…

    Linux干货 2015-05-11
  • RAID(重要)

    RAID   RAID(Redundent Array of Independent Disk):独立的冗余磁盘阵列,目的是为了结合多个物理驱动器组成单个单元,提高了磁盘的性能或保证数据冗余。RAID能够防止硬件的故障导致数据丢失,但是不能防止人为操作,软件故障、恶意软件感染等造成的数据丢失,因此不能替代备份。 分类有:硬件实现RAID(一是外接式磁盘阵列柜…

    Linux干货 2016-08-30
  • Linux 登录趣事

    初入Linux运维,在虚拟机VMware12中装载CentOS6和CentOS7,均带有图形化界面。简单熟悉Linux,发现了一些关于登录的趣事,在此与大家分享。 运行环境:CentOS6和CentOS7 工具:系统里的terminal 登录趣事(以CentOS6为例): (1)自动登录图形化界面 每次启动CentOS6,短暂等待之后便会进入登录界面,然后选…

    2017-07-15
  • 马哥教育网络班19期+第九周课程练习

    1、写一个脚本,判断当前系统上所有用户的shell是否为可登录shell(即用户的shell不是/sbin/nologin),分别这两类用户的个数,通过字符串比较来实现。 #!/bin/bash for user_shell in `awk -F: '{print $7}'&nbsp…

    Linux干货 2016-07-01