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.www58058.com/75854

(0)
fsyfsy
上一篇 2017-05-15
下一篇 2017-05-15

相關推薦

  • 程序包管理rpm

    Linux程序包管理      API:Application Program Interface      ABI:Application Binary Interface         Unix…

    Linux干貨 2016-08-23
  • 【】

         

    Linux干貨 2016-10-30
  • MairaDB之基于openssl的主從復制

    一、配置openssl   1、   在master server(node0)上根CA的搭建(及生成自簽名證書) [root@node0 ~]# cd /etc/pki/CA/ [root@node0 CA]# (umask 077;openssl genrsa -out private/cakey.pem 2048) Gen…

    2016-11-19
  • 磁盤管理(一)磁盤分區表類型與文件系統

    概述:本章介紹磁盤分區和文件系統,深度了解linux存儲數據所依賴到各個部分模塊。 設備文件 I/O Ports: I/O設備地址 一切皆文件: Linux為所有的設備文件都提供了統一的操作函數接口,方法是使用數據結構struct file_operations。這個數據結構中包括許多操作函數的指針,如open()、close()、read()和write(…

    Linux干貨 2016-09-01
  • linux進程管理

    進程概念 內核的功用:進程管理、文件系統、網絡功能、內存管理、驅動程序、 安全功能等 Process:  運行中的程序的一個 副本,是被 載入內存的一個指令集合     進程ID (Process ID,PID)號碼被用來標記各個進程  &…

    Linux干貨 2016-09-12
  • 磁盤陣列(RAID)簡介

    資料 RAID(Redundant Arrays of Inexpensive Disks 廉價磁盤冗余陣列)即磁盤陣列,磁盤陣列是由多個價格比較便宜的磁盤組合成的一個容量巨大的磁盤組,其原理是利用數組方式來制作磁盤組,配合數據分散排列的設計,配合數據分散排列的設計,提升數據的安全性。它把數據分別存放在多個硬盤上,輸入輸出操作能以平衡的方式交疊,改良性能,因…

    Linux干貨 2017-04-17
欧美性久久久久