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

相关推荐

  • M22 wireshark使用方法简介

    wireshark是一款著名的开源抓包软件,它可以抓取网卡的数据包,以供网络管理员分析。 一 安装方法 debain系安装方法: sudo add-apt-repository ppa:wireshark-dev/stable sudo apt update sudo apt install wireshark 启动wireshark: sudo wires…

    2017-03-20
  • 第一天作业

    一、计算机的组成部分         现代计算机的组成是根据冯.诺依曼体系,包括5大部件存储器、控制器、运算器、输入设备和输出设备。             1.存储器包括内部存储器和外部存储器;内部存储器包括内部硬盘、内存、缓存等,外部存储器包括移动硬盘、光…

    Linux干货 2016-08-15
  • Hello World

    随笔

    Linux干货 2018-03-26
  • Linux基础小模块

    1.基础知识小块:shell 由shell程序的自带命令:即为内置命令(builtin) 独立的可执行程序文件、文件名 :即为外部命令  [root@localhost~]#ls      ~用户当前所在目录  #:命令提示符(管理员帐号root)  $:普通用户   &nbsp…

    Linux干货 2016-08-05
  • 基于Keepalived+Nginx实现高可用负载均衡

    练习贴,测试keepalived+lvs_dr高可用负载均衡

    2017-12-11
  • 磁盘管理

    设备文件 I/O Ports: I/O 设备地址 一切皆文件: open(), read(), write(), close() 设备类型: 块设备:block ,存取单位“块”,磁盘 [root@localhost ~]# ll /dev/ brw-rw—-. 1 root disk 253, 0 Apr 29 03:53 dm-0 块设备 brw-r…

    2017-04-28