From 64ef4fa958878ceedfc8009804898f439cdeaf0f Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 6 Nov 2015 14:28:14 +0100 Subject: [PATCH] CLOUDSTACK-5822: keep user-added sshkeys in authorized_keys --- setup/bindir/cloud-set-guest-sshkey.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/bindir/cloud-set-guest-sshkey.in b/setup/bindir/cloud-set-guest-sshkey.in index 0472a7c006c..03d57f53660 100755 --- a/setup/bindir/cloud-set-guest-sshkey.in +++ b/setup/bindir/cloud-set-guest-sshkey.in @@ -81,8 +81,8 @@ if [ ! -e $authorized ]; then chmod 600 $authorized fi -cat $authorized|grep -v "$publickey"|tee $authorized > /dev/null -echo "$publickey" >> $authorized +sed -i "/ cloudstack@apache.org$/d" $authorized +echo "$publickey cloudstack@apache.org" >> $authorized which restorecon && restorecon -R -v $sshdir