Skip to content

Commit 64ef4fa

Browse files
committed
CLOUDSTACK-5822: keep user-added sshkeys in authorized_keys
1 parent f948e96 commit 64ef4fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

setup/bindir/cloud-set-guest-sshkey.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ if [ ! -e $authorized ]; then
8181
chmod 600 $authorized
8282
fi
8383

84-
cat $authorized|grep -v "$publickey"|tee $authorized > /dev/null
85-
echo "$publickey" >> $authorized
84+
sed -i "/ cloudstack@apache.org$/d" $authorized
85+
echo "$publickey cloudstack@apache.org" >> $authorized
8686

8787
which restorecon && restorecon -R -v $sshdir
8888

0 commit comments

Comments
 (0)