Red Hat Bugzilla – Bug 496013
/root/.ssh/authorized_keys not created with proper type
Last modified: 2009-05-01 14:05:25 EDT
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
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.
Fixed in selinux-policy-3.6.12-23.fc11.noarch
Run restorecon -R -v /root after you create the directory or run restorecond