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文件系统事件:inotify使用指南

    如何监控Linux文件系统事件:inotify使用指南 §·inotify初识 Inotify 是一个 Linux特性,它监控文件系统操作,比如读取、写入和创建。Inotify 反应灵敏,用法非常简单,并且比 cron 任务的繁忙轮询高效得多。学习如何将 inotify 集成到您的应用程序中,并发现一组可用来进一步自动化系统治理的命令行工具。 §·inoti…

    Linux干货 2016-10-30
  • N26-肉肉-第一周作业

    1.描述计算机的组成及其功能CPU:运算器、控制器、寄存器、缓存存储器:内存,RAM(Random Access Memory)    IO:输入输出设备2.按系列罗列linux的发行版本,并描述不同发行版本之间的联系与区别。发行版有数百种之多,著名的主流发行版有3种Debian,Slackware,RedHatDebian:使…

    Linux干货 2017-01-03
  • linux下小练习(2)

    1、编写脚本/bin/per.sh,判断当前用户对指定的参数文件,  是否不可读并且不可写                         2、编写脚本/root/bin/nologin.sh和login.sh,实现禁止和充 许…

    Linux干货 2016-08-15
  • 计算机基础

    小白入门

    2018-03-08
  • 26期全程班-第一周博客作业

    1、描述计算机的组成与功能。 计算机由以下五大单元组成: 一:CPU的算法计算和逻辑判断单元; 二:CPU的控制单元;协调各设备协同工作。 三:内存:RAM(random accace memory)随机读取内存;数据处理的必经路段。 四:输入设备:键盘、鼠标等;负责数据的输入。 五:输出设备:屏幕、终端、文件、硬盘等;负责数据的输出 2、按系列罗列Linu…

    Linux干货 2016-12-30
  • 计算机网络基础知识与Linux网络配置

    本文主要内容是: 1.讲述网桥、集线器、二层交换机、三层交换机、路由器的功能、使用场景与区别。 2、IP地址的分类有哪些?子网掩码的表示形式及其作用 3、计算机网络的分成模型有哪些(OSI模型和TCP/IP模型),每一层的功能及涉及到的物理设备有哪些。 4、如何给网络接口配置多个地址,有哪些方式? 5、常用的网络管理类工具有哪些,并用示例形式描述他们的使用方…

    Linux干货 2016-11-14