#!/bin/bash # # Script to generate a cloud-config file with a custom user and the script user SSH public key as authorized key # cat << EOF > cloud-init-conf.yml #cloud-config users: - name: ansuser ssh-authorized-keys: - $(cat ~/.ssh/id_rsa.pub) sudo: ['ALL=(ALL) NOPASSWD:ALL'] groups: sudo shell: /bin/bash EOF