install-aws-server: Add code for transferring an SSH key.

For quick iteration, sometimes you want a server to have an SSH key
(e.g. a GitHub deploy key for your fork).
This commit is contained in:
Tim Abbott 2017-10-05 21:58:40 -07:00
parent d9c26c307c
commit 4b24b9f0e7
1 changed files with 6 additions and 0 deletions

View File

@ -116,6 +116,12 @@ env VIRTUALENV_NEEDED=$VIRTUALENV_NEEDED PUPPET_CLASSES="$type" \
./scripts/setup/install
EOF
scp "${SSH_OPTS[@]}" -i "$amazon_key_file" "$server_private_key_file" root@"$server":/home/zulip/.ssh/id_rsa
scp "${SSH_OPTS[@]}" -i "$amazon_key_file" "$server_private_key_file".pub root@"$server":/home/zulip/.ssh/id_rsa.pub
ssh "${SSH_OPTS[@]}" "$server" -t -i "$amazon_key_file" -lroot <<EOF
chown zulip:zulip /home/zulip/.ssh/id_rsa*
chmod 600 /home/zulip/.ssh/id_rsa*
EOF
set +x
cat <<EOF