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

相关推荐

  • Nginx 负载均衡多个nmmp主机

    设计拓扑图 一、Memcache简介 cache(缓存系统) 高性能分布式缓存服务器,缓存所有的“可流式化”数据:livejournal旗下Danga Interacive公司 程序=指令+数据 指令:程序 数据:IO操作 文件系统: 特征:协议简单  基于libevent的事件处理  内置内存存储方式  memcached 不…

    2014-09-17
  • 马哥linux0726课程内容

    课堂内容笔记   使用几个符号可以使用原始命令 \,’’,绝对路径运行 这三种方法都可以使用到原始命令,不使用别名   别名-内部命令-缓存-外部命令 使用命令的优先级   man帮助具体用法 makewhatis老版本安装whatis mandb新版本安装whatis man的具体路径在/usr/share/man whati…

    Linux干货 2016-08-04
  • linux 入门基础 (二)

    主要内容包含有 文件查找、压缩和正则表达式,以及包是管理和安装。

    2017-09-10
  • Linux磁盘管理

    设备文件 一切皆文件 open(), read(), write(), close() 磁盘结构 磁盘接口类型 并行 IDE:133MB/s SCSI:640MB/s 串口 SATA:6Gbps SAS:6Gbps USB:480MB/s rpm rotationsper minute 硬盘每分钟转数 硬盘结构  图一…

    Linux干货 2016-08-30
  • 1019作业

    1019作业 柴震 软连接 硬连接 软连接和硬链接的区别 属性与定义: 硬链接:新建的文件是已经存在的文件的一个别名,所以创建时链接数递增;而且当原文件删除时,新建的链接文件仍然可以使用,因其直接对应于数据块。 软链接:也称为符号链接。新建的链接文件以“路径”的形式来表示另一个文件,其大小为指向的路径字符串的长度,不增加或减少目标文件in…

    Linux干货 2016-10-19
  • 文件系统挂载

    挂载: 将额外文件系统与根文件系统某现存的目录建立起关联关系,进而使得此目录做为其它文件访问入口的行为 卸载: 为解除此关联关系的过程 把设备关联挂载点:mount Point mount 卸载时:可使用设备,也可以使用挂载点 umount mount   umount命令都是临时生效,机器重启后失效 挂载点下原有文件在挂载完成…

    Linux干货 2017-04-30