Merge branch 'main' from arvados-workbench2.git
[arvados.git] / tools / salt-install / terraform / aws / services / user_data.sh
index 6c5b574dd7c464dc9ddeb878ba5dcef7220f38c5..ada3e84ad9046964ff134f29122e8c8fe168ee79 100644 (file)
@@ -17,3 +17,9 @@ while true; do
 done
 
 apt-get -o Acquire::ForceIPv4=true install -y git curl
+
+SSH_DIR="/home/${deploy_user}/.ssh"
+if [ ! -d "$${SSH_DIR}" ]; then
+  install -d -o ${deploy_user} -g ${deploy_user} -m 700 $${SSH_DIR}
+fi
+echo "${ssh_pubkey}" | install -o ${deploy_user} -g ${deploy_user} -m 600 /dev/stdin $${SSH_DIR}/authorized_keys