Bug#658675: /usr/bin/ssh-copy-id: selinux contexts as in/for compatibility with RHEL/Fedora
tag 658675 + patch
thanks
Hi,
I've attached a patch that should fix this issue. It's calling
restorecon after adding the key to ~/.ssh/authorized_keys. It's similar
to the patch added to the centos/redhat rpm.
Cheers
Laurent Bigonville
--- a/contrib/ssh-copy-id
+++ b/contrib/ssh-copy-id
@@ -41,7 +41,7 @@ fi
# strip any trailing colon
host=`echo $1 | sed 's/:$//'`
-{ eval "$GET_ID" ; } | ssh $host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys" || exit 1
+{ eval "$GET_ID" ; } | ssh $host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys; test -x /sbin/restorecon && /sbin/restorecon ~/.ssh ~/.ssh/authorized_keys" || exit 1
cat <<EOF
Now try logging into the machine, with "ssh '$host'", and check in:
Reply to: