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
下一篇 2017-05-15

相关推荐

  • Linux系统下的翻译神器——Goldendict

    Linux系统下的翻译神器——Goldendict 学习Linux时明显感受到学习英文的重要性。绝大多数Linux的发行版英文版的功能要远强于中文。因此一款好的翻译软件是了解熟悉Linux系统的必需品。在Windows系统下有各种好用的词典程序,包括有道词典、bing词典、金山词霸等等,而这些软件都不能在linux下使用,即使能够使用也只是测试版,功能太少。…

    Linux干货 2017-04-24
  • 文件权限

    普通文件 r: 可以读取文件的内容 w: 可以修改文件的内容 x: 可以执行该文件 执行脚本(不要随便给文件加x权限) 目录文件 r: 用户可以列出目录下有哪些文件(不能查看文件的详细信息) w: 只有w无意义。 x: 用户可以进入该目录(如果知道文件名,且有相对应的文件权限 ,可以执行对应的操作) 权限一般配合使用,不同权限配合有不同效果 rx: 用户可以…

    2017-07-30
  • 程序包管理的前端工具YUM及案例一二

    程序包管理前端工具–YUM        yum:yellowdog update modifier        yum工具为CS架构 yum仓库(yum repository):yum repo   &n…

    Linux干货 2016-08-24
  • Linux文件属性及如何修改文件属性

    ls -al:显示文件的文件名与相关属性并列出所有文件详细的权限与属性   dr-xr-x—.   7       root     root       4…

    2017-04-03
  • N26-第五周

    1、显示当前系统上root、fedora或user1用户的默认shell;[root@localhost ~]# grep -E ‘^(root|fedora|user1)\>’ /etc/passwdroot:x:0:0:root:/root:/bin/bashfedora:x:4002:4002:Fedora Core:/h…

    Linux干货 2017-03-13
  • Jerry的学习计划/目标/宣言

    学习计划 按照班主任给的计划进度来,多动手做实验。 目标 勇敢做自己,做更好的自己 宣言 能不能成为高富帅,日后是否能愉快地装逼,就看这半年!

    Linux干货 2016-10-24