Bug 496013

Summary: /root/.ssh/authorized_keys not created with proper type
Product: [Fedora] Fedora Reporter: Dax Kelson <dkelson>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dwalsh, jkubin, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-01 18:05:25 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 Dax Kelson 2009-04-15 23:49:28 UTC
Description of problem:

I installed a rawhide box today (April 15th, 2009), I installed a authorized_keys file to /root/.ssh/authorized_keys and key based SSH authentication wouldn't work.

My installation procedure was:

(/root/.ssh/ directory already existed on the rawhide box)

anotherbox# cd /root/.ssh/
anotherbox# scp authorized_keys rawhidebox:.ssh/

Over on rawhide box here are the permissions and selinux type on the file:

[root@rawhidebox .ssh]# ls -alZ
drwx------. root root unconfined_u:object_r:admin_home_t:s0 .
drwxr-x---. root root system_u:object_r:admin_home_t:s0 ..
-rw-------. root root unconfined_u:object_r:admin_home_t:s0 authorized_keys
-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 known_hosts
[root@rawhidebox .ssh]# 

Note that 'admin_home_t' on authorized_keys.

I'm unable to use key based auth until I run restorecon the authorized_keys file (which sets it to home_ssh_t).

Using scp to install an authorized_keys file is very typical. This needs to work.

Comment 1 Daniel Walsh 2009-05-01 18:05:25 UTC
Fixed in selinux-policy-3.6.12-23.fc11.noarch

Run restorecon -R -v /root after you create the directory or run restorecond