packer: move authorized_keys setup to cloud-init.

This commit is contained in:
2023-04-13 09:55:54 -07:00
parent abaf3c76f6
commit f6e1ee3af9
3 changed files with 52 additions and 14 deletions

View File

@@ -13,14 +13,6 @@ case "${ID}" in
SYSTEM_USER=root
SYSTEM_HOME=/root
;;
esac
echo "[+] setting up ssh"
apt-get -y install openssh-server
SSH_DIR="${SYSTEM_HOME}/.ssh"
mkdir -p ${SYSTEM_HOME}/.ssh
chmod 0700 ${SSH_DIR}
mv /tmp/authorized_keys ${SSH_DIR}/authorized_keys
chmod 0644 ${SSH_DIR}/authorized_keys