我已经build立了一个与SElinux的Debian机器,除了从远程机器的rsync ,一切工作正常。 我已经使用audit2allow创build了一些具有额外权限的模块,现在审计日志中的所有错误都消失了。 当我尝试rsync到机器,但不幸的是,连接仍然是不允许的。 设置selinux宽容,一切都按预期工作。
我没有运行rsync作为守护进程,这通常会导致networking中的问题报告出现更多的问题。 rsync只是默认的Debian 7configuration。
远程rsync失败并显示以下消息:
user1@othermachine:~$ rsync -vv servermachine:/home/user1/some/file . opening connection using: ssh servermachine rsync --server --sender -vve.Lsf . /home/user1/some/file rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]
这是rsync的权限如何:
root@host:~# ls -Z /usr/bin/rsync system_u:object_r:rsync_exec_t:SystemLow /usr/bin/rsync
当我以宽容模式运行远程rsync和服务器时,我看到如下过程:
root@host:~# ps aux|grep rsync user1 22948 1.0 0.0 26680 5156 ? Ds 11:08 0:00 rsync --server --sender -vlogDtpre.iLsf . /home/user1/some/file root 22954 0.0 0.0 11292 924 pts/0 S+ 11:09 0:00 grep rsync root@host:~# ps -eZ | grep rsync unconfined_u:system_r:rsync_t:s0-s0:c0.c1023 22948 ? 00:00:00 rsync
例如,scp对同一个文件没有问题。 我已经给rsync的附加权限如下所示。 我不确定他们是否过于慷慨或什么,但他们至less解决了audit.log出现的问题。
allow rsync_t user_home_t:file { read write getattr open }; allow rsync_t sshd_t:fifo_file { write read }; allow setfiles_t device_t:filesystem getattr; allow setfiles_t devpts_t:filesystem getattr; allow setfiles_t tmpfs_t:filesystem getattr; allow setfiles_t sysfs_t:filesystem getattr;
所以,最让我困扰的是,我没有看到任何AVC条目,但它仍然不起作用。 有什么,增加冗长? 怎么可能,有些权利不被授予,但是没有AVC条目? 其次,我有点惊讶,我没有find任何networking上的问题的参考,只有selinux / rsync作为守护进程运行的问题。 但是我也不知道,我的configuration有什么特别之处。 因此,任何关于诊断的进一步的想法将是受欢迎的!
我遇到了与SELinux和MySQL类似的问题。 运行'semodule -B -D'重置事件到我可以看到剩余的审计问题。
原来的问题在这里 。