From 42f1adf64ff614e80ac00b78d4349558d4a5e09d Mon Sep 17 00:00:00 2001 From: Paul Maunders Date: Thu, 17 Jan 2013 16:55:27 +0000 Subject: [PATCH] Updating ssh-copy-id to latest version Adds support for SELinux enabled systems --- ssh-copy-id.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ssh-copy-id.sh b/ssh-copy-id.sh index b5dc0ca..6d3007a 100644 --- a/ssh-copy-id.sh +++ b/ssh-copy-id.sh @@ -19,7 +19,7 @@ if [ "-i" = "$1" ]; then shift # and this should leave $1 as the target name fi else - if [ x$SSH_AUTH_SOCK != x ] && ssh-add -L >/dev/null 2>&1; then + if [ x$SSH_AUTH_SOCK != x ] ; then GET_ID="$GET_ID ssh-add -L" fi fi @@ -38,14 +38,13 @@ if [ "$#" -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then exit 1 fi -{ eval "$GET_ID" ; } | ssh ${1%:} "umask 077; test -d .ssh || mkdir .ssh ; cat >> .ssh/authorized_keys" || exit 1 +{ eval "$GET_ID" ; } | ssh $1 "umask 077; test -d .ssh || mkdir .ssh ; cat >> .ssh/authorized_keys; test -x /sbin/restorecon && /sbin/restorecon .ssh .ssh/authorized_keys" || exit 1 cat <