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的ls 常用选项

    ls 命令   ls[OPTION]…[FILE]….选项 和 参数可有可无。 定义:显示指定路径下的文件列表。  -a: 全拼是all,所有的意思,ls  -a能显示出所有的文件,包括隐藏的。点开头和..开头的隐藏文件都能看见。  -l:后跟文件 可以查看文件的大小,和权限(一般用户都有读的权…

    2017-05-21
  • rsync+inotify实现数据的实时同步更新

      rsync可以实现触发式的文件同步,但是通过crontab守护进程方式进行触发,同步的数据和实际数据会有差异,而inotify可以监控文件系统的各种变化,当文件有任何变动时,就触发rsync同步,这样就可以解决同步数据的实时性问题。 一、rsync的优点与不足 rsync具有安全性高、备份迅速、支持增量备份等优点,通过rsync可以解决对实时性要求不高的…

    2018-01-06
  • N_28文件类管理命令

    1.linux文件管理类命令有:mkdir ,rmdir,cp ,mv,rm,ls,vi,cat ,cut,sort,wc等 mkdir –make directories  (创建目录) 用法 :mkdir [OPTION]… DIRECTORY… -P  按需要创建目录的父目录; -v  显示创建的详细过程; -m M…

    2017-12-09
  • 初入马哥教育的感受

    记录来马哥教育的点滴记录及感受。。

    Linux干货 2018-03-26
  • Linux基础介绍

    1、Linux用户: Linux用户分为普通用户和管理员,普通用户的系统操作权限低,用户的误操作对系统数据的破坏程度有限,不会对系统造成灾难性的破坏。而管理员对系统具有绝对的权限,可以修改和设置系统的任何数据,如果误操作,及其容易对系统数据造成不可挽回的破坏,比如执行以下命令 rm  -rf  / 。因此,系统管理员在操作root用户时需…

    Linux干货 2016-07-26
  • 马哥教育网络班21期第8周课程练习

    1、请描述网桥、集线器、二层交换机、三层交换机、路由器的功能、使用场景与区别。 网桥也叫桥接器,是连接两个局域网的一种存储/转发设备,用来连接不同网段。 集线器称为“Hub”,主要功能是对接收到的信号进行再生整形放大,以扩大网络的传输距离,同时把所有节点集中在以它为中心的节点上。 二层交换机工作于OSI模型的第2层(数据链路层),可识别数据包中的MAC地址信…

    Linux干货 2016-09-19