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

相关推荐

  • N22期-第4周作业

    1、复制/etc/skel目录为/home/tuser1,要求/home/tuser1及其内部文件的属组和其它用户均没有任何访问权限。 [root@localhost ~]# cp -r /etc/skel /home/tuser1 [root@localhost ~]# chmod&nb…

    Linux干货 2016-09-05
  • Net25-第10周作业

    1、请详细描述CentOS系统的启动流程(详细到每个过程系统做了哪些事情) Centos系统启动过程分内核空间启动和用户空间启动: 内核空间启动流程: POST: post加点自检,检测计算机基本5大件是否完好,计算机可被正常点亮。 BootSequence: 位于ROM上的BIOS的BootSequence来选择启动顺序 Bootloader: 决定启动顺…

    Linux干货 2017-03-15
  • rsync+inotify实现数据同步——单向传输

    实验环境:<从A主机推送数据到B主机[B主机可以有多个]> A主机:10.1.43.102 B主机:10.1.43.103 配置流程: —rsyncserver—- <B主机上配置> 1.vim /etc/rsyncd.conf(用户,目录,模块,虚拟用户及密码文件) vim /etc/rsyncd.…

    Linux干货 2016-10-27
  • 命令read

    read命令是一个bash命令,它用于从键盘或标准输入中读取文本.我们可以使用read以交互的形式读取来自用户的输入.并且read还提供一种不需要按回车就能够输入参数的方法. read可以从标准输入中读取单独的一行,或者使用-u选项,从文件描述符FD中读取.并且这单独的行被分隔成多个域,第一个词被赋值给第一个变量,第一个赋值给第二个变量,以此类推,直到剩下的…

    Linux干货 2016-08-12
  • 文本处理工具 练习

    7.1 练习   1 、找出ifconfig 命令结果中本机的所有IPv4 地址 2 、查出分区空间使用率的最大百分比值   3 、查出用户UID 最大值的用户名、UID 及shell 类型 4 、查出/tmp 的权限,以数字方式显示   5 、统计当前连接本机的每个远程主机IP 的连接数,并按从大到小排序   &nb…

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

    1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可。 who | cut -d" " -f 1 |sort |uniq 2、取出最后登录到当前系统的用户的相关信息。 last | head -…

    Linux干货 2016-07-29