Articles of selinux

Fedora 15 PHP exec()不起作用

我不能通过PHP exec()函数运行可执行文件。 操作系统:Fedora 15 PHP safe_modeclosures PHP代码是: $exe = "/tmp/defne/./CwCssUGxhjAc"; $result = system( $exe, $retval ); chmod 777 on /tmp/defne和/tmp/defne/CwCssUGxhjAc 我可以通过命令行运行它: sudo -u apache /tmp/defne/CwCssUGxhjAc 当我通过PHP脚本调用whoami时,PHP给了apache。 我可以通过PHP运行其他可执行文件,如gcc,whoami等。 但是我不能运行一个C / C ++编译的二进制文件。 在Apache错误日志中说: sh: /tmp/defne/./CwCssUGxhjAc permission denied Selinux已启用。 PS:我不想禁用SELinux。 感谢你的创意,如果你build议禁用selinux。 我同样可以禁用我的电脑的电源插头。

Selinux干扰vboxwebsrv或phpvirtualbox

我有一个全新安装的Fedora 18,安装了全新的Virtualbox 4.2。 我花了几个小时试图让phpVirtualBox工作。 安装了Apache 2.4和PHP 5.4以及phpVirtualBox软件。 试图访问phpVirtualBox允许我login,但是,我会有一个长时间的等待,直到“错误获取HTTP头”的消息出现。 最后,我把SeLinux设置为宽容,宾果! 事情开始工作。 由于某些原因,SeLinux故障排除程序没有标记来自SeLinux的任何消息,我不知道现在要查找什么。 这是一个开发框,所以我可以让SeLinux设置为宽容,但是我将需要在下一个项目中愤怒地做这个工作。 我的问题是:SeLinux策略需要做什么修改才能让phpVirtualBox和vboxwebsrv一起工作? 如果有更多的信息我可以发布,这将有助于我很乐意发布 – 只是让我知道它是什么。

sudo:PAM audit_log_acct_message()失败:权限被拒绝

..任何时候我通过NRPE运行sudo ,我在/var/log/secure得到以下消息,我无法弄清楚如何解决它。 sudo: PAM audit_log_acct_message() failed: Permission denied 请指教。 *更新* [root@XXXXX ~]# ausearch -m avc -ts today | tail type=SYSCALL msg=audit(1381429383.104:128936): arch=c000003e syscall=44 success=no exit=-13 a0=8 a1=7fffd40dfac0 a2=8 a3=0 items=0 ppid=24708 pid=24711 auid=4294967295 uid=0 gid=496 euid=0 suid=0 fsuid=0 egid=496 sgid=496 fsgid=496 tty=(none) ses=4294967295 comm="sudo" exe="/usr/bin/sudo" subj=system_u:system_r:nrpe_t:s0 key=(null) type=AVC msg=audit(1381429383.104:128936): avc: denied { sendto } for […]

新的Dovecot安装不允许login,尽pipe说权限“出现好”

我正在将dovecot安装到运行Ubuntu Server 64位14.04 guest虚拟机的Virtualbox VM上。 Dovecot本身正在被安装到一个Docker容器中(我不确定这是否与此有关,但为了以防万一)。 我无法让dovecot允许我通过telnetlogin来使用passwd文件testing用户身份validation。 鸽子似乎已经安装好了。 我已经用sudo dovecot启动了它,现在正在按照http://wiki2.dovecot.org/TestInstallation上的wiki指南进行testing。 在容器内,我inputtelnet localhost 143 。 Dovecot与* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot (Ubuntu) ready.连接正确* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot (Ubuntu) ready. 。 然后我inputa login "test" "test" ,但得到以下输出: a NO [AUTHENTICATIONFAILED] Authentication failed. 我已经确认这个命令在一个现有的(工作的)Ubuntu […]

诊断rsync错误输出

我inheritance了Centos 6.5系统,在运行rsync时输出多行错误。 rsync正在同步到本地连接的作为/storage驱动器。 该命令是: rsync -aAXv /* /storage/backup/ –exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/storage/*} 有三种不同types的错误logging在下面# Error concern 1, # Error concern 2, # Error concern 3在下面的输出中: rsync -aAXv /* /storage/backup/ –exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/storage/*} sending incremental file list etc/cron.d/ root/ root/.bash_history root/.viminfo selinux/booleans/abrt_anon_write selinux/booleans/abrt_handle_event selinux/booleans/allow_console_login […] # Error concern 1: There are probably 80 or more of these mkstemp errors, but I've shortened […]

我如何告诉SELinux在特定的目录下给vsftpd写入权限?

我已经在我的Fedora 12服务器上设置了vsftpd,我想要进行以下configuration。 每个用户都应该可以访问: 他的主目录(/ home / USER); 我为他创build的网页目录(/ web / USER)。 为了达到这个目的,我首先configuration了vsftpd来将每个用户chroot到他的主目录。 然后,我用正确的权限创build/web/USER ,并使用mount –bind /web/USER /home/USER/Web以便用户可以通过/home/USER/Web访问/web/USER 。 我还打开了SELinux的布尔型ftp_home_dir以便vsftpd被允许写入用户的主目录。 除了当用户尝试上传或重命名/home/USER/Web的文件时,这种方式非常有效,SELinux禁止它,因为还必须对/web/USER进行更改,而SELinux不会将vsftpd权限授予写任何东西到该目录。 我知道我可以通过打开SELinux boolean allow_ftpd_full_access或ftpd_disable_trans来解决问题。 我也尝试使用audit2allow来生成一个策略,但是它所做的是生成一个策略,使ftpd可以对public_content_ttypes的目录进行写入访问; 这相当于打开allow_ftpd_full_access ,如果我理解正确的话。 我想知道是否可以将SELinuxconfiguration为允许通过FTP写入特定目录/web/USER及其内容,而不是完全禁用SELinux的FTP控件。

在执行模式下,selinux不会运行Postfix

我在Fedora 15上启用了selinux强制模式,并且能够使apache,mysql和memcached正常工作,但是我无法运行postfix。 我有以下错误: systemd[1]: Unit postfix.service entered failed state. kernel: [146194.117602] type=1400 audit(1318924444.361:3809): avc: denied { module_request } for pid=15447 comm="postfix" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system kernel: [146194.145456] type=1400 audit(1318924444.389:3810): avc: denied { module_request } for pid=15452 comm="master" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system kernel: [146194.146585] type=1400 audit(1318924444.390:3811): avc: denied { module_request } for pid=15452 comm="master" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 […]

设置指向用户目录中的文件的Apache虚拟主机。 在Ubuntu上工作得很好,现在我在Fedora上

我最近从Ubuntu转移到Fedora。 我现在希望自己能够做得更早,因为我意识到我对Linux的了解并不像我应该做的那么多–Ubuntu对我隐瞒了很多。 以前在Ubuntu上,我有几个虚拟主机指向我的用户的主目录中的目录: /home/foo/Code/PHP/somedir/ 这是一个虚拟主机: <VirtualHost *:80> DocumentRoot /home/foo/Code/PHP/somedir <Directory /home/foo/Code/PHP/somedir/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> ServerName database.dev </VirtualHost> 我已经在我的hosts文件中设置了database.dev 。 我到目前为止所做的:在将虚拟主机添加到/etc/httpd/conf.d/database.dev.conf – 这是正确的地方吗?),我重新启动了Apache。 我收到了一些SELinux警告,并使用Fedora附带的工具对它们进行了疑难解答。 在重新启动Apache或在浏览器中查看http://database.dev/ ,我不再获得SELinux警告。 但是,我仍然得到403错误。 在DocumentRoot for database.dev ,我创build了一个名为“hello.txt”的文件,我试图在浏览器中访问它。 玩文件权限和所有权没有任何作用。 这里是错误日志的一个片段: [Sat Dec 31 20:20:34 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /hello.txt denied […]

httpd,vsftpd和烦人的selinux

我有一个安装了httpd运行和vsftpd的CentOS 6.3,但是我无法平衡用户能够通过ftp上传和他们的网站工作的权限。 我做的事: I create a user with their home directory as `/home/username` I create a sub folder called `html` for their website I chown their directory `chown -R username:apache /home/username` I chmod their directory `chmod -R 750 /home/username` I chcon their directory `chcon -R -t httpd_sys_rw_content_t /home/username` 和他们的网站加载好,但他们无法FTP,但如果我做以下,他们可以FTP但他们的网站不加载: chcon -R -t user_home_dir_t /home/username 如果我禁用selinux,用户可以ftp和网站加载。 […]

在EC2 SELinux实例上丢失密码

正如标题所说,我有一个EC2上的SELinux实例,我还没有使用一段时间。 自从发射回来以来,我一直无法通过ssh来访问它。 我以前曾经从这台机器上访问过它,并且AWS上的安全组内容被设置为允许ssh访问。 我根本无法login到机器,所以我所有的修复都被限制在我能做的事情上,把根卷挂载到一个新的EC2实例上,并以我能做到的方式做。 以下是我迄今为止所尝试的: 1)尝试将我的ssh密钥复制到ssh用户的authorized_keys文件中。 当我尝试SSH时,密码提示仍然存在。 2)validationsshd_config有PasswordAuthentication no 3)使用chroot设置挂载的卷为root,然后重置用户的密码,我试图login为。 从这里没有任何错误,但新的密码不通过ssh的提示工作。 4)我使用的ssh密钥没有密码,所以这不是我被提示的密码。 5)再次使用chroot,我尝试使用.ssh文件夹中的'restorecon'命令为有问题的用户 6)确保用户的.ssh目录的权限设置为700,并且.ssh / authorized_keys文件将其设置为600 到目前为止,还是没有喜悦。 我还有什么可以尝试?