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

相关推荐

  • Linux软件包管理之rpm和yum的使用

    rpm命令的使用 什么是RPM? rpm:RPM Package Manager (原Redhat Package Manager) Linux 软件包管理工具 特定的程序由应用程序组成;     GPL:源码     glibs:标准的C库 常见Linux发行版的软件包管理器:…

    Linux干货 2016-08-25
  • redis主/从配置及基于sentinel的故障转移

     一、NoSQL基础概念: ACID:原子性、一致性、隔离性、持久性;特性:数据量大、数据变化非常大(数据增长化、流量分布变化、数据间耦合结构变化)、数据源很多; CAP、BASECAP C:多个数据节点的的数据一致;A:用户发出请求后的有限时间范围内返回结果;P:network partition,网络发生分区后,服务是否依可用;CAP理论:一个分布式系统…

    Linux干货 2017-12-18
  • inode总结

    inode的介绍以及影响inode号的命令

    2017-11-13
  • Linux脚本基础练习

    马哥教育网络班+ 第7周课堂练习 Linux脚本基础练习 练习: 1、创建一个10G分区,并格式为ext4文件系统; (1)要求其block大小为2048,预留空间百分比为2,卷标为MYDATA,默认挂载属性包含acl (2)挂载至/data/mydata目录 要求挂载时禁止程序自动运行,且不更新文件的访问时间戳 第一步,在虚拟机中挂载一块20G的新硬盘 &…

    Linux干货 2016-11-09
  • shell脚本编程基础

    shell脚本编程基础以及一些基本的逻辑运算知识和shell的配置用户环境。

    2017-11-26
  • shell脚本小练习..

    刚刚接触vim和shell脚本,用几个小脚本练练手。 1、编写脚本/root/bin/systeminfo.sh,显示当前主机系统信息,包括主机名,IPv4地址,操作系统版本,内核版本,CPU型号,内存大小,硬盘大小。 2、编写脚本/root/bin/backup.sh,可实现每日将/etc/目录备份到/root/etcYYYY-mm-dd中。 3、编写脚本…

    2017-04-13