selinux

Proper way to set SeLinux with Apache VirtualHost reading from a mount?

只谈情不闲聊 提交于 2019-12-08 10:58:08
问题 I have a mount that I need to setup a VirtualHost from. /opt/foo When I create the VirtualHost with SeLinux on, Apache reports that the directory does not exist. When I set SeLinux to permissive mode, it works fine. What is the proper way to setup my /opt/foo directory so that it will work with Apache and SeLinux when it is enforcing? 回答1: The first thing first, permissive mode means that SELinux just log denials into audit log, but nothing is really denied. It is just for debugging and

How to audit the selinux denial inside a docker container

吃可爱长大的小学妹 提交于 2019-12-08 07:53:56
问题 I have a docker container, when disable selinux, it works well; but when enabled selinux (i.e. the docker daemon is started with --selinux-enabled), it can not start up. So the failure should caused by selinux denial, but this is not shown in the selinux audit log. when I use the "ausearch -m XXX | audit2allow ..." to generate the policy, it does not include any denial info. want to know how to get the selinux denial info occured inside the container, so that I can use it in generating my

SELinux Enforcing not honouring httpd_enable_homedirs -> off

ε祈祈猫儿з 提交于 2019-12-08 06:15:38
问题 Why am I able to access http://localhost/~myusername in Fedora20 with SELinux set to Enforcing , if the httpd_enable_homedirs boolean is set to off ? The following is a direct excerpt from the fedoraproject's wiki on SELinux about the httpd_enable_homedirs boolean: httpd by default is not allowed to access users home directories. If you want to allow access to users home directories you need to set the httpd_enable_homedirs boolean and change the context of the files that you want people to

Nginx can't create log files

只愿长相守 提交于 2019-12-08 04:58:28
I've just installed nginx on fresh CentOS 7. My config has such lines: access_log <path to log dir>/access.log; error_log <path to log dir>/error.log error; All parts of the <path to log dir> have 0777 permissions. Nginx can't start: [root@host dir]# systemctl start nginx.service Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details. [root@host dir]# systemctl status nginx.service nginx.service - nginx - high performance web server Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled) Active: failed (Result: exit-code) since Пт 2015-08

SELinux prevented httpd(usr/sbin/httpd) write access to /var/www/html/bookings/templates_c

我们两清 提交于 2019-12-08 01:06:24
问题 I am using a framework which uses Smarty template engine. It works fine in Windows, but when I tried to run it in LAMP server, I got a message like SELinux has detected suspicious behaviour on your system . The whole error message i have attached. Please guide me what to do. Thanks 回答1: You can allow it by using setsebool -P httpd_unified=1 Normal SELinux settings for http to work with PHP more or less properly are: setsebool -P httpd_enable_cgi on setsebool -P httpd_unified on setsebool -P

SELinux Enforcing not honouring httpd_enable_homedirs -> off

…衆ロ難τιáo~ 提交于 2019-12-07 23:43:26
Why am I able to access http://localhost/~myusername in Fedora20 with SELinux set to Enforcing , if the httpd_enable_homedirs boolean is set to off ? The following is a direct excerpt from the fedoraproject's wiki on SELinux about the httpd_enable_homedirs boolean: httpd by default is not allowed to access users home directories. If you want to allow access to users home directories you need to set the httpd_enable_homedirs boolean and change the context of the files that you want people to access off the home dir. I have a directory within the /home/user/ directory that I had set up in a

lLinux网络相关命令,防火墙介绍及相关命令

耗尽温柔 提交于 2019-12-07 21:33:54
​10月25日任务 10.11 Linux网络相关 10.12 firewalld和netfilter 10.13 netfilter5表5链介绍 10.14 iptables语法 10.11、Linux网络相关 ifconfig查看网卡IP (yum install -y net-tools) ifup eth0/ifdown eth0 设定虚拟网卡eth0:1 mii-tool eth0 查看网卡是否连接 ethtool ens33 也可以查看网卡是否连接 更改主机名 hostname set-hostname aminglinux DNS配置文件/etc/resolv.conf /etc/hosts文件 #,因为是远程连接 ,所致只能演示同时运行关闭网卡和开启网卡。(当修改指定网卡配置信息后可以运行这条命令重启网卡) [root@centos6 ~]# ifdown eth0 && ifup eth0 Determining if ip address 172.16.5.235 is already in use for device eth0... #设置一个虚拟的网卡信息 [root@centos6 ~]# cd /etc/sysconfig/network-scripts/ [root@centos6 network-scripts]# ls ifcfg-eth0

教你玩转Linux系统目录结构

﹥>﹥吖頭↗ 提交于 2019-12-07 21:01:39
Linux 内核最初只是由芬兰人林纳斯·托瓦兹(Linus Torvalds)在赫尔辛基大学上学时出于个人爱好而编写的。Linux 是一套免费使用和自由传播的类 Unix 操作系统,是一个基于 POSIX 和 UNIX 的多用户、多任务、支持多线程和多 CPU 的操作系统。Linux 能运行主要的 UNIX 工具软件、应用程序和网络协议。它支持 32 位和 64 位硬件。Linux 继承了 Unix 以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。 教你玩转Linux—系统目录结构教你玩转Linux—系统目录结构 登录系统后,在当前命令窗口下输入 命令 : ls / 你会看到如下图所示: 教你玩转Linux—系统目录结构教你玩转Linux—系统目录结构 树状目录结构: 教你玩转Linux—系统目录结构教你玩转Linux—系统目录结构 以下是对这些目录的解释: /bin: bin是Binary的缩写, 这个目录存放着最经常使用的命令。 /boot: 这里存放的是启动Linux时使用的一些核心文件,包括一些连接文件以及镜像文件。 /dev : dev是Device(设备)的缩写, 该目录下存放的是Linux的外部设备,在Linux中访问设备的方式和访问文件的方式是相同的。 /etc: 这个目录用来存放所有的系统管理所需要的配置文件和子目录。 /home: 用户的主目录

修改Linux SSH的端口与SELinux究竟是什么

ぃ、小莉子 提交于 2019-12-07 20:44:09
最近,发现修改ssh端口后,无法启动ssh服务,发现是SELinux限制了这个,此篇文章简单记录下。 SELinux简介 SELinux 主要作用就是最大限度地减小系统中服务进程可访问的资源(最小权限原则)。 SELinux 有三种工作模式,分别是: enforcing:强制模式。违反 SELinux 规则的行为将被阻止并记录到日志中。 permissive:宽容模式。违反 SELinux 规则的行为只会记录到日志中。一般为调试用。 disabled:关闭 SELinux。 SELinux 工作模式可以在 /etc/selinux/config 中设定。 如果想从 disabled 切换到 enforcing 或者 permissive 的话,需要重启系统。反过来也一样。 enforcing 和 permissive 模式可以通过 setenforce 1|0 命令快速切换。 修改ssh端口方法 首先需要关闭SELinux,有两种方法: 修改文件 /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

查看 SELinux状态及关闭SELinux

牧云@^-^@ 提交于 2019-12-07 18:53:07
查看SELinux状态: 1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态 SELinux status: enabled 2、getenforce ##也可以用这个命令检查 关闭SELinux: 1、临时关闭(不用重启机器): setenforce 0 ##设置SELinux 成为permissive模式 ##setenforce 1 设置SELinux 成为enforcing模式 2、修改配置文件需要重启机器: 修改/etc/selinux/config 文件 将SELINUX=enforcing改为SELINUX=disabled 重启机器即可 来源: oschina 链接: https://my.oschina.net/u/593529/blog/281871