Articles of selinux

redhat Apache fast-cgi selinux权限

我的Apache安装是运行的PHP作为fastcgi,和虚拟 主机指向/ home / / public_html。 和fastcgi是家/ /cgi-bin/php.fcgi 与selinux public_html设置是: /usr/sbin/setsebool -P httpd_enable_homedirs 1 chcon -R -t httpd_sys_content_t /home/someuser/public_html 所有者和组是用户,例如用户“someuser”: ls -all /home/someuser/cgi-bin/ drwxr-xr-x 2 someuser someuser 4096 Sep 7 13:14 . drwx–x–x 6 someuser someuser 4096 Sep 6 18:17 .. -rwxr-xr-x 1 someuser someuser 308 Sep 7 13:14 php.fcgi ls -all /home/someuser/public_html/ | greep […]

sshd :错误:ssh_selinux_setup_pty:security_compute_relabel:无效的参数?

OpenSSH_5.8p1,OpenSSL 0.9.8e-fips-rhel5 2008年7月1日 SELinux的政策2.4.6-338.el5 PAM-0.99.6.2-12.el5 SELinux运行在宽容模式下: # sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: permissive Mode from config file: disabled Policy version: 21 Policy from config file: targeted 每当我通过sshlogin, /var/log/secure抱怨: sshd[4957]: Accepted publickey for quanta from 192.168.3.40 port 55822 ssh2 sshd[4957]: pam_unix(sshd:session): session opened for user quanta by (uid=0) sshd[4957]: error: ssh_selinux_setup_pty: security_compute_relabel: […]

检查我的内核是否支持SELinux

我想知道我运行的内核是否支持SELinux。 我会用什么命令来检查这个?

SELinux干扰Apache / PHP

在安装CentOS 7时,SELinux默认是启用的。 这会阻止Apache正确读取标准/ var / www / html文档根目录中的PHP文件(当显示包含PHP脚本的网页时,浏览器是空白的)。 当我禁用SELinux时,页面显示正常。 有没有设置SELinux以允许Apache从文档根访问PHP文件的方法? 我宁愿不要完全禁用SELinux,因为CentOS明确地认为这是一个理想的安全补充。

Selinux“添加上下文规则到Semanage”

当您添加或更改新规则到fcontext semanage到任何目录并应用时,egg: # How to add this rule for apply changes whit restoreconf -Rv /var/www/html(/.*)?/media(/.*)? system_u:object_r:httpd_sys_rw_content_t:s0 # Here found all files have .bin and conf /etc/selinux/targeted/contexts/files 是否要应用的结果是使用平均httpd文件夹来写入和读取SELinux没有问题。 semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/domain.com/media #restorecon -Rv not apply changes

SELinux的 – mysql /和httpdoc /在同一个文件夹?

看起来我的老忠实的LAMP目录结构已经与SELinux脱钩。 我更喜欢在同一个地方的一切。 CentOS 6.6 Apache 2.2.15 MySQL 6.5 /DATA/ /DATA/httpdocs/ /DATA/mysql/ /DATA/server-config.php /DATA/httpd-error.logs… 如果我这样做,然后Apache工作正常,但MySQL不会启动。 chcon -R -t httpd_sys_content_t /DATA/ chcon -R -t mysqld_db_t /DATA/mysql chcon -R -t httpd_sys_content_t /DATA/httpdocs 如果我这样做,然后MySQL将启动,但Apache不会启动。 chcon -R -t mysqld_db_t /DATA chcon -R -t mysqld_db_t /DATA/mysql chcon -R -t httpd_sys_content_t /DATA/httpdocs 我知道这是关联到我附加到根/ DATA文件夹的标签,他们不能有两个? 是的,如果我禁用SELinux,所有的问题都会消失,但是这个项目是必需的。 这些文件夹是chown和chmod罚款。 对于mysql的情况下,错误是 2015-04-24 14:17:56 3391 [Warning] Can't […]

在SELinux中添加自定义的“允许”策略

我想允许httpd从用户的主目录执行文件。 从audit2allow我明白,这意味着以下政策: allow httpd_t user_home_t:file execute; 如何将其转换为在CentOS服务器上启用此策略的脚本? 我已经为httpd_read_user_content和httpd_enable_homedirs启用了布尔值,但没有帮助。

无法在Red Hat上启用绑定9的日志logging

当我启用绑定logging时,我得到了一个权限被拒绝的错误,这是由于在chroot / selinux中运行的绑定(avc denied write)。 我不知道如何重新configuration​​selinux以允许日志文件是可写的。 请有人可以帮忙吗? 谢谢!!

SELinux阻止Asterisk连接到IMAP服务器进行语音邮件

我在Fedora 23上运行Asterisk,并使用语音邮件IMAP模块将语音邮件存储到Gmail。 当SELinux处于强制模式时,它会阻止Asterisk连接到Gmail。 以下是/var/log/audit/audit.log中的错误消息: type=AVC msg=audit(1460344333.315:70807): avc: denied { name_connect } for pid=823 comm="asterisk" dest=993 scontext=system_u:system_r:asterisk_t:s0 tcontext=system_u:object_r:pop_port_t:s0 tclass=tcp_socket permissive=0 正因为如此,我被迫将SELinux置于宽容模式。 如何解决SELinux阻止Asterisk阻止出站连接?

SELinux一直阻止我的Apache实例

我正在使用CentOS 7,并在那里使用systemd结构设置了一个重复的Apache实例。 如果我使用setenforce 0,我可以同时运行Apaches。但是,当我setenforce 1时,新的Apache将无法启动。 我尽我所能去查看所有创build的文件,并使用“ls -Z”复制了SELinuxtypes,然后chcon与httpd相同。 我得到的失败消息是: [Thu Jun 23 23:51:24.123185 2016] [core:notice] [pid 24944] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0 [Thu Jun 23 23:51:24.124434 2016] [suexec:notice] [pid 24944] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Jun 23 23:51:24.146830 2016] [auth_digest:notice] [pid 24944] AH01757: generating secret for digest authentication … [Thu Jun […]