selinux

CentOs 7中安装zabbix

北城以北 提交于 2019-11-28 17:33:55
安装zabbix报错,按照官网的Zabbix Manual,zabbix的dashboard提示:zabbix server is not running the information displayed may not be current。 SELinux出于安全考虑,会阻止zabbix server的http通信端口10051。同时,如果zabbix要使用fping,需要设置相应规则。 一、关闭SELinux   查看SElinux状态:   1.sudo sestatus -v |grep status    [root@comd-localhost ~]# sudo sestatus -v |grep status   SELinux status: enabled   Policy MLS status: enabled   Policy deny_unknown status: allowed   2.查看模式: getenforce      [root@comd-localhost ~]# getenforce   Enforcing   关闭SELinux:   3.临时关闭:setenforce 0   setenforce 0       #setenforce 1 设置SELinux 成为enforcing模式   #setenforce 0

unit18 linux中的selinux简单介绍

笑着哭i 提交于 2019-11-28 16:07:47
################# selinux ################# #1.selinux 内核级加强型防火墙 1.针对文件,会对系统中每个文件添加安全上下文(context) 2.针对进程,会对系统中的每个进程添加全上下文(context) 3.会在系统服务上设定sebool开关 4.当进程安全上下文和文件的安全上下文不匹配时,那么进程无法访问此文件 5.sebool会限制服务的不安全功能,如果需要用此功能,必须调整sebool值 ####管理selinux selinux的开关 vim /etc/sysconfig/selinux SELINUX=enforcing ##selinux开启,级别为强制 SELINUX=permissive ##selinux开启,级别为警告 SELINUX=disabled ##selinux关闭, setenforce 0|1 ##更改selinux当前的级别0警告1标示强制 getenforce ##查看selinux的状态 注意:当selinux从关到开,或者从开到关,需要重启系统 等待界面 #临时更改适用于更改文件 chcon -t 安全上下文 文件 chcon -t public_content_t /var/ftp/file #永久更改文件安全上下文 semanage fcontext -l semanage

Tell SELinux to Give Apache Execute Access to PHP Files Outside Document Root

走远了吗. 提交于 2019-11-28 13:43:32
I have a directory where shared PHP scripts are kept (the name is arbitrary, but it isn't /var/, /usr/, or anything that SELinux would have specific settings for): /whatever/scripts/ These scripts can get executed by cronjobs, or may get executed by Apache or Tomcat so the output can be included in a web page. SELinux is denying permission: type=AVC msg=audit(1363205612.276:476923): avc: denied { execute } for pid=6855 comm="sh" name="script.php" dev=sda3 ino=4325828 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:etc_runtime_t:s0 tclass=file type=SYSCALL msg=audit

20180914 文件和目录的权限以及属性

僤鯓⒐⒋嵵緔 提交于 2019-11-28 13:39:20
文件或目录权限: ls -l 目录或文件 # 查看文件详细信息 -rw-r--r--. 1 root root 4865 9月 14 09:18 a.txt # 第一列中除了第一位文件类型,剩下的9位是权限控制位,分3段,每3位(读,写,执行)为一个权限位 # 第一段(rw-)权限位是文件所有者的权限 # 第二段(r--)权限位是所属组的权限 # 第三段(r--)权限位是除所有者、所属组之外的其他用户权限 # 权限可以用数字表示: r=4 w=2 x=1 rwx=7 rw-=6 --x=1 命令chmod(change mode) ls -l test.txt -rw-r--r--. 1 root root 0 9月 15 17:28 test.txt chmod 700 test.txt ls -l test.txt -rwx------. 1 root root 0 9月 15 17:28 test.txt # 9位权限位后的点(.)表示文件受制于SELinux chmod 权限 文件/目录 # 只更改对应的文件及目录的权限 chmod +R 权限 目录 # 目录下的子文件,子目录的权限全做更改 chmod u=rwx,g=r,o=r test.txt # 把test.txt的权限更改为 744 chmod a+x test.txt # a表示所有,即三个权限位都添加执行(x

linux学习第十章使用Apache服务部署静态网站

杀马特。学长 韩版系。学妹 提交于 2019-11-28 11:04:56
一、 网站服务程序 Web网络服务是一种被动访问的服务程序,即只有接收到互联网中其他主机发出的请求后才会响应,最终用于提供服务程序的Web服务器会通过HTTP(超文本传输协议)或HTTPS(安全超文本传输协议)把请求的内容传送给用户 目前能够提供Web网络服务的程序有IIS、Nginx和Apache等 IIS:是window中默认的程序 Nginx:2004年俄罗斯研制出Nginx,Nginx程序作为一款轻量级的网站服务软件,因其稳定性和丰富的功能而快速占领服务器市场,但Nginx最被认可的还当是系统资源消耗低且并发能力强 Apache:程序作为老牌的Web服务程序,一方面在Web服务器软件市场具有相当高的占有率,另一方面Apache也是RHEL 7系统中默认的Web服务程序,而且还是RHCSA和 RHCE 认证考试的必考内容, 安装Apache: 1、安装httpd服务 需要使用到yum,步骤跳过具体在:https://my.oschina.net/u/4159006/blog/3093819中 yum install httpd d代表环绕 2、在浏览器中输入自己的IP地址出现以下画面。 出现这个画面预示着可能存在两个问题 (1)这个网站没有内容, (2)这个网站没有权限 那么下面逐一验证 echo hahahah >> /var/www/htme/index.html

Linux就该这么学10学习笔记

纵然是瞬间 提交于 2019-11-28 10:59:54
参考链接: https://www.linuxprobe.com/chapter-10.html 网站服务程序 第1步 :把光盘设备中的系统镜像挂载到/media/cdrom目录。 [root@linuxprobe ~]# mkdir -p /media/cdrom [root@linuxprobe ~]# mount /dev/cdrom /media/cdrom mount: /dev/sr0 is write-protected, mounting read-only 第2步 :使用Vim文本编辑器创建Yum仓库的配置文件 [root@linuxprobe ~]# vim /etc/yum.repos.d/rhel7.repo [rhel7] name=rhel7 baseurl=file:///media/cdrom enabled=1 gpgcheck=0 第3步 :动手安装Apache服务程序。注意,使用yum 命令 进行安装时,跟在命令后面的Apache服务的软件包名称为httpd。如果直接执行yum install apache命令,则系统会报错。 [root@linuxprobe ~]# yum install httpd Loaded plugins: langpacks, product-id, subscription-manager ……………

解决zabbix的web界面zabbix服务器端运行中 显示为 不

夙愿已清 提交于 2019-11-28 10:00:43
有可能是SELINUX没有关闭导致的 临时关闭: [root@localhost ~]# getenforce Enforcing [root@localhost ~]# setenforce 0 [root@localhost ~]# getenforce Permissive 永久关闭: [root@localhost ~]# vim /etc/sysconfig/selinux SELINUX=enforcing 改为 SELINUX=disabled 重启服务reboot 来源: https://www.cnblogs.com/andy940/p/11404062.html

快速部署 Kubeadm 1.13 集群ETCD(转同事)

China☆狼群 提交于 2019-11-28 07:46:34
转自同事脚本 ,部分根据集群微调 软件环境清单 kubeadm.x86_64 Version :1.13.1-0 kubelet.x86_64 Version : 1.13-1-0 kubectl.x86_64 Version : 1.13-1-0 kubernetes-cni.x86_64 Version : 0.6.0-0 docker Version 18.06.1-ce 一、更改系统部署参数 # 安装Wget yum install wget -y # 关闭 firewalld 防火墙 systemctl stop firewalld && systemctl disable firewalld # 关闭交换分区 swapoff -a && sed -i 's/.*swap.*/#&/' /etc/fstab # 禁用selinux setenforce 0 sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/sysconfig/selinux sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config sed -i "s/^SELINUX=permissive/SELINUX=disabled/g" /etc/sysconfig

linux关闭SElinux

眉间皱痕 提交于 2019-11-28 05:04:28
一、永久关闭SElinux 1、查看SElinux状态 getenforce 或者 sestatus -b 2、修改SElinux配置文件 文件位置 /etc/selinux/config ---------- SELinux 有三种工作模式,分别是: 1. enforcing:强制模式。违反 SELinux 规则的行为将被阻止并记录到日志中。 2. permissive:宽容模式。违反 SELinux 规则的行为只会记录到日志中。一般为调试用。 3. disabled:关闭 SELinux。 ---------- 3、直接修改为disabled,然后重启 ------------------------------------------------------------ 二、临时切换 临时关闭SELinux setenforce 0 临时打开SELinux setenforce 1 注意:永久关闭后不能临时切换 来源: https://www.cnblogs.com/lazy-sang/p/11392892.html

Attempt to write a readonly database - Django w/ SELinux error

柔情痞子 提交于 2019-11-28 04:29:26
I have a CentOS server on which I have Apache, Django, Django CMS and mod_wsgi. My Django project files are stored in the /srv directory and I have SELinux turned on for security reasons. I've managed to successfully integrate Django-CMS into Django and when I visit the local IP, I see my pages. However, when I try to visit /admin (where I can start making use of the CMS functionality), I get DatabaseError at /admin/ attempt to write a readonly database . Okay. So, since I have a .sqlite file in my project folder, I ran a ls -l on it which returned: -rw-r--r--. 1 root root 133120 Jan 5 11:53