Articles of selinux

SELinux – FCGID程序被阻止,并且没有login/var/log/audit/audit.log

我有一个设置,我的Web服务器上的某个链接被redirect到一个FCGID模块。 当我用' setenforce 0 '禁用SELinux时,该站点工作。 当我启用它将无法正常工作,它给了我一个“错误500 – 内部服务器错误”。 我习惯于修复这些SELinux错误,但是当我查看audit.log时 ,没有与Apache或我的fcgid程序相关的新条目。 在过去,当我有一个SELinux的错误,每次我刷新页面,它给了我一个新的条目在这个文件。 刷新网站后,我的apache error_log添加这些条目: [Thu Jul 07 14:34:04.240551 2016] [fcgid:warn] [pid 18054] (104)Connection reset by peer: [client XXX.XXX.XXX.XXX:34622] mod_fcgid: error reading data from FastCGI server [Thu Jul 07 14:34:04.240629 2016] [core:error] [pid 18054] [client XXX.XXX.XXX.XXX:34622] End of script output before headers: rt-server.fcgi 这是我的服务器信息: OS: CentOS Linux […]

使用SELinux在CentOS中创build多个SFTP用户(安装在AWS EC2中)

我很难让别人FTP / SFTP到我们的网站。 我有多个虚拟名称服务器创build,每个人都运行自己的网站。 所以,我想给FTP / SFTP访问用户。 我遵循这个Serverfault论坛问题中所述的相同的步骤。 确保所有文件夹(不是文件)都是755的根目录,并作为所有者的根。 我的步骤如下, 添加一个组 groupadd sftp 创build用户 useradd -d /var/www/vivektest.com.au/public_html vivek passwd vivek 添加到组和修改的bin usermod -g sftp vivek usermod -s /sbin/nologin vivek 修改了SSHDconfiguration Subsystem sftp internal-sftp Match group sftp X11Forwarding no ChrootDirectory %h AllowTcpForwarding no ForceCommand internal-sftp 重新启动sshd服务。 确保主文件夹是根拥有的。 sudo ls -ld /var/www/vivektest.com.au/public_html drwxr-xr-x. 2 root root 23 […]

SELinux在删除后停止pam_oddjob_mkhomedir重新创build家目录

我有一个连接到LDAP的RedHat 7服务器,应该自动创build主文件夹。 根据RedHat的build议,我使用pam_oddjob_mkhomedir.so 。 如果用户从未login到系统,一切工作正常。 如果主文件夹已被删除,则会出现问题,它们被视为此系统上的暂存区域。 删除后主文件夹不会重新创build,用户欢迎使用 Could not chdir to home directory /home/users/username: No such file or directory 有人可以解释一下吗? 更新:我发现SELinux正在造成这种情况。 如果SELinux处于宽容模式,一切正常。 我不想禁用SELinux,我将不胜感激在正确configuration它的任何帮助。 ANOTER更新: 在/var/log/audit/audit.log中find了一些相关的日志 type=AVC msg=audit(1493820202.276:178): avc: denied { add_name } for pid=2631 comm="mkhomedir" name="robot" scontext=system_u:system_r:oddjob_mkhomedir_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nfs_t:s0 tclass=dir type=AVC msg=audit(1493820202.276:178): avc: denied { create } for pid=2631 comm="mkhomedir" name="robot" scontext=system_u:system_r:oddjob_mkhomedir_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nfs_t:s0 tclass=dir type=AVC msg=audit(1493820202.276:179): […]

SELinux:如何在同一个文件上允许apache,samba和tomcat访问

运行RedHat 7.4 直到最近我可以使用 semanage fcontext -a -t public_content_rw_t '/var/www(/.*)?' restorecon -R /var/www 从回答https://serverfault.com/a/346779/125461上我如何让SELinux允许Apache和Samba在同一个文件夹? 。 但public_content_rw_t不再适用于tomcat(tomcat-7.0.76-2.el7.noarch) 我设法通过使用来解决问题 semanage permissive -a tomcat_t 但我正在寻找允许tomcat&httpd读取和samba读取和写入的上下文,或允许rw到tomcat,httpd&samba的上下文。 或者,是否有可能更改tomcat使用httpd上下文的上下文?

为什么ModSecurity无法访问数据目录?

更新我想我们已经解决了这个问题。 这个问题似乎是/ modsec_storage目录的SELinux上下文types的值不正确的结果。 但是,我们仍然不确定,因为虽然在更改SELinux上下文types值后,Apache能够在全局和ip集合(global.dir / global.pag和ip.dir / ip)的目录中创build文件。 pag),新文件仍然有零字节。 我是ModSecurity的新手,不确定这些文件是否为空,因为configuration有问题,或者ModSecurity只是简单地确定在每个事务结束后不需要永久存储IP地址。 任何人都可以在这里提供指导? 我最近在我们的生产服务器上安装了ModSecurity(v2.5.12 / CRS v2.0.8),除了这些写入Apache错误日志的错误之外,一切都很好。 Failed to access DBM file "/modsec_storage/global": Permission denied [hostname "www.internationalstudent.com"] [uri "/includes/soc_bookmarks/images/delicious.png"] [unique_id "LZ6jc38AAAEAAFO6408AAABO"] Failed to access DBM file "/modsec_storage/ip": Permission denied [hostname "www.internationalstudent.com"] [uri "/includes/soc_bookmarks/images/delicious.png"] [unique_id "LZ6jc38AAAEAAFO6408AAABO"] 按照Ivan Ristic的ModSecurity手册中的文件权限设置说明,没有成功,我创build了/ modsec_storage目录,将所有者和组设置为apache,并将目录权限recursion设置为777。 但是,ModSecurity仍然报告相同的权限错误,所以我很难过。 谁能告诉我如何解决这个问题?

SeLinux阻止连接到Ubuntu 9.10上的sshd

当我尝试login到运行Ubuntu 9.10的笔记本电脑时,服务器拒绝我的login尝试。 检查/var/log/auth.log,我看到以下内容: Feb 14 12:41:16 tiger-laptop sshd[6798]: error: ssh_selinux_getctxbyname: Failed to get default SELinux security context for tiger 我search了这个,并跑过了以下内容: http://www.spinics.net/lists/fedora-…/msg13049.html 以下是我认为与我遇到的问题有关的部分: 引用: 我的系统有什么问题? 为什么即使selinux处于宽容模式也无法login? 有什么build议么? 我开始试图找出为什么sshd没有运行在sshd_t(它似乎是在sysadm_t运行)。 保罗。 selinux邮件列表selinux @ xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mail…stinfo/selinux 是的,sshd在sysadm_t中运行: ps axZ | grep sshd system_u:system_r:sysadm_t 3632? Ss 0:00 / usr / sbin / sshd -o PidFile = / var / run […]

使用SELinux强制Linux允许程序绑定到低于1024的端口号

在SELinux中有一种方法来强制linux允许程序能够绑定到低于1024的端口号。

从Apache传出psql连接的selinux设置

os:centos 6 目前我已经启用selinux服务器的宽容,我希望它被设置为强制,但在同一时间selinux应该禁用传出psql连接从Apache .. 我已经设置了这个阿帕奇 chcon -R -h -t httpd_sys_content_t project/ 但从Apache的postgres通信失败,禁用SELinux使其工作… 任何想法什么参数是在Apache的postgresql ..

禁用Yum的PostInst RestoreCon操作

当我在Fedora 15盒子上更新“selinux-policy-targeted”包时,作为yum的post-inst操作的一部分,调用整个磁盘的restorecon来更改磁盘上的selinux上下文以匹配新的规则。 然而,我有一个服务器,有一个相当大的磁盘arrays,具有非常多的小文件,并且大部分时间都有相当高的IO负载,所以这个动作需要非常长的时间(字面上是几天 )来执行这个动作。 有什么办法强制这个restorecon不发生,或者至less让我从这个动作排除一个目录树,所以我可以更新操作系统的上下文重要的事情(即configuration目录等),但不是我的数据.. 。

引导挂在SELINUX上?

SELINUX在这个机器(这是Xen下的一个CentOS实例)上是禁用的,但引导过程到了一个提到审计和SELINUX的地步,然后挂起。 它会回来吗? Registering block device major 202 xvda: xvda1 xvda2 xvdb: unknown partition table device-mapper: ioctl: 4.11.0-ioctl (2006-09-14) initialised: [email protected] kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. SELinux: Disabled at runtime. SELinux: Unregistering netfilter hooks audit(1319018877.561:2): selinux=0 auid=4294967295 或者我应该多关注“未知的分区表”消息?