Bug 996193

Summary: SELinux is preventing /usr/sbin/sshd from 'open' accesses on the file /mnt/smb/devapp151/.ssh/authorized_keys.
Product: [Fedora] Fedora Reporter: greg.hellings
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:6d9ad0839d08cf62b16cdea407d7702a1c361c50f60837a2e43c47d727b47ea9
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-19 14:52:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description greg.hellings 2013-08-12 15:39:03 UTC
Description of problem:
1) Enable SSH
2) Try to log in from a remote system over SSH
3) Observe that the broken piece of shit that is SELinux causes this simple task to fail.
This is lame and SELinux is lame. Get the fuck rid of the broken shit and allow me to set my file permissions and have them honored as they should be.


SELinux is preventing /usr/sbin/sshd from 'open' accesses on the file /mnt/smb/devapp151/.ssh/authorized_keys.

*****  Plugin catchall_boolean (89.3 confidence) suggests  *******************

If you want to support SAMBA home directories
Then you must tell SELinux about this by enabling the 'use_samba_home_dirs' boolean.
You can read 'None' man page for more details.
Do
setsebool -P use_samba_home_dirs 1

*****  Plugin catchall (11.6 confidence) suggests  ***************************

If you believe that sshd should be allowed open access on the authorized_keys file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep sshd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:sshd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:cifs_t:s0
Target Objects                /mnt/smb/devapp151/.ssh/authorized_keys [ file ]
Source                        sshd
Source Path                   /usr/sbin/sshd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           openssh-server-6.2p2-5.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-69.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.10.5-201.fc19.x86_64 #1 SMP Wed
                              Aug 7 16:25:24 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-08-12 10:34:10 CDT
Last Seen                     2013-08-12 10:34:10 CDT
Local ID                      660f794f-6f01-424b-b60a-7925cd3344b3

Raw Audit Messages
type=AVC msg=audit(1376321650.790:478): avc:  denied  { open } for  pid=2559 comm="sshd" path="/mnt/smb/devapp151/.ssh/authorized_keys" dev="cifs" ino=43149021 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:cifs_t:s0 tclass=file


type=SYSCALL msg=audit(1376321650.790:478): arch=x86_64 syscall=open success=yes exit=EINTR a0=7f2d9c5ddd30 a1=800 a2=1 a3=7f2d98d2f2e0 items=0 ppid=933 pid=2559 auid=4294967295 uid=0 gid=0 euid=1000 suid=0 fsuid=1000 egid=1000 sgid=0 fsgid=1000 ses=4294967295 tty=(none) comm=sshd exe=/usr/sbin/sshd subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)

Hash: sshd,sshd_t,cifs_t,file,open

Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.10.5-201.fc19.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-08-13 22:09:20 UTC
Thank you for your support.  If you read the alert, it told you exactly what had to be done.

*****  Plugin catchall_boolean (89.3 confidence) suggests  *******************

If you want to support SAMBA home directories
Then you must tell SELinux about this by enabling the 'use_samba_home_dirs' boolean.
You can read 'None' man page for more details.
Do
setsebool -P use_samba_home_dirs 1

Comment 2 greg.hellings 2013-08-13 22:37:06 UTC
Well, good try. But

1) Samba is not in use on this system
2) The home directory is on a local disk
3) I ran the second portion of the suggestion
# grep sshd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp
twice and the error still happens.

Thus, this is a bug. And it continues to be one.

Comment 3 Daniel Walsh 2013-08-14 12:15:42 UTC
type=AVC msg=audit(1376321650.790:478): avc:  denied  { open } for  pid=2559 comm="sshd" path="/mnt/smb/devapp151/.ssh/authorized_keys" dev="cifs" ino=43149021 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:cifs_t:s0 tclass=file


type=SYSCALL msg=audit(1376321650.790:478): arch=x86_64 syscall=open success=yes exit=EINTR a0=7f2d9c5ddd30 a1=800 a2=1 a3=7f2d98d2f2e0 items=0 ppid=933 pid=2559 auid=4294967295 uid=0 gid=0 euid=1000 suid=0 fsuid=1000 egid=1000 sgid=0 fsgid=1000 ses=4294967295 tty=(none) comm=sshd exe=/usr/sbin/sshd subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)

Hash: sshd,sshd_t,cifs_t,file,open

THis avc indicates that you have a file /mnt/smb/devapp151/.ssh/authorized_keys that is labeled as cifs_t, which is the label of samba shares. Indicating either this is a samba share mounted from another machine or it is a directory that was moved off of a samba share.