Bug 964163 - SELinux is preventing /usr/bin/ssh from 'append' accesses on the file /root/.ssh/known_hosts.
SELinux is preventing /usr/bin/ssh from 'append' accesses on the file /root/....
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-05-17 07:56 EDT by Markus Schulze
Modified: 2013-05-23 08:27 EDT (History)
3 users (show)

See Also:
Fixed In Version: selinux-policy-3.11.1-96.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-05-23 08:27:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Markus Schulze 2013-05-17 07:56:04 EDT
Description of problem:
SELinux is preventing /usr/bin/ssh from 'append' accesses on the file /root/.ssh/known_hosts.

*****  Plugin catchall (100. confidence) suggests  ***************************

If sie denken, dass es ssh standardmässig erlaubt sein sollte, append Zugriff auf known_hosts file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# grep ssh /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:mount_t:s0
Target Context                unconfined_u:object_r:ssh_home_t:s0
Target Objects                /root/.ssh/known_hosts [ file ]
Source                        ssh
Source Path                   /usr/bin/ssh
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           openssh-clients-6.1p1-8.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-92.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.8.11-200.fc18.x86_64 #1 SMP Wed
                              May 1 19:44:27 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-05-17 13:55:03 CEST
Last Seen                     2013-05-17 13:55:03 CEST
Local ID                      88f7a77a-e722-464c-bbaa-b41c453069c8

Raw Audit Messages
type=AVC msg=audit(1368791703.582:3069): avc:  denied  { append } for  pid=24962 comm="ssh" name="known_hosts" dev="sda4" ino=786593 scontext=system_u:system_r:mount_t:s0 tcontext=unconfined_u:object_r:ssh_home_t:s0 tclass=file

type=SYSCALL msg=audit(1368791703.582:3069): arch=x86_64 syscall=open success=no exit=EACCES a0=7fda64bac140 a1=441 a2=1b6 a3=238 items=0 ppid=1 pid=24962 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=ssh exe=/usr/bin/ssh subj=system_u:system_r:mount_t:s0 key=(null)

Hash: ssh,mount_t,ssh_home_t,file,append


#============= mount_t ==============
allow mount_t ssh_home_t:file append;

audit2allow -R
require {
	type mount_t;

#============= mount_t ==============

Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.11-200.fc18.x86_64
type:           libreport
Comment 1 Daniel Walsh 2013-05-17 08:18:12 EDT
Were you mounting a sshfs file system?  Why would ssh be running as mount_t?
Comment 2 Markus Schulze 2013-05-17 08:22:34 EDT
I use autofs with fuse and sshfs to connect to another server. The automount process is running as root
Comment 3 Daniel Walsh 2013-05-17 10:36:18 EDT
d7900d40924d4874e999eaba96bd88378e5dce5e allows this in git.
Comment 4 Miroslav Grepl 2013-05-20 05:30:06 EDT
Back ported.
Comment 5 Fedora Update System 2013-05-20 09:41:02 EDT
selinux-policy-3.11.1-96.fc18 has been submitted as an update for Fedora 18.
Comment 6 Fedora Update System 2013-05-21 04:43:36 EDT
Package selinux-policy-3.11.1-96.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-96.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2013-05-23 08:27:18 EDT
selinux-policy-3.11.1-96.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.