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

相关推荐

  • LVS的工作原理

    LB Load Balancing:解决方案 硬件: F5 BIG-IP 思杰 Citrix Netscaler A10 A10 Array  Redware 软件:lvs  linux Virtual Server 作者章文嵩博士 ipvs相当于netfilter,工作在内核中,将用户转发    框架,需要依赖以规则…

    Linux干货 2016-12-07
  • NTP时间服务器

        在集群环境和需要日志同步的多服务器应用中,为了能够保证多台服务器的之间的正常协作,就必须使它们的时间保持一致,在多台服务器上手动调整时间是极其不科学的,这时就需要借助于NTP时间服务器来完成时间的同步。     一、NTP服务器的安装    …

    Linux干货 2015-06-25
  • LVS类型及其调度算法

    LVS类型:     NAT:–>(DNAT) (多目标的DNAT)     DR:     TUN:     FULLNAT: LVS NAT的特性  &nbs…

    Linux干货 2016-10-29
  • 马哥教育网络22班第二周课程练习

    1,Linux上的文件管理类命令有哪些?其常用的使用方法机器相关实例演示 文件管理类命令:   cp 文件复制         常用选项:             -i:交互式           &…

    Linux干货 2016-08-30
  • linux系统启动及kickstart

    1、简述linux操作系统启动流程
    2、简述grub启动引导程序配置及命令行接口详解
    3、实现kickstart文件制作与光盘镜像制作

    2018-01-17