autoinstall: version: 1 locale: en_US.UTF-8 keyboard: layout: us timezone: Asia/Shanghai # Select the destination disk interactively; installation can erase it. interactive-sections: - storage identity: hostname: ubuntu-agent username: ubuntu password: "$6$GI/yDsvYuCJAWJvQ$REA0V9KXOxxy.1rCrDZ3WviRSPRhWLRbvdf0pQ67VS0pjHdHH77Rm2cdYX6ZNhGm..GjIUhq1jb3HZa8XYIsZ0" ssh: install-server: true allow-pw: true packages: - curl - ca-certificates - python3 late-commands: - [curtin, in-target, --target=/target, --, usermod, --password, "$6$IseQLoyBCEDXolQf$hZ3P4ybZVLzADGjA9YnhPjOqkF2J8h3XO70xVCL/RXjC.FbDOF.RM0n0HFWPvXTni6vQDy7iB3kkcU1KK66M..", root] - | mkdir -p /target/etc/ssh/sshd_config.d printf '%s\n' 'PermitRootLogin yes' 'PasswordAuthentication yes' > /target/etc/ssh/sshd_config.d/00-local-access.conf - [curtin, in-target, --target=/target, --, /usr/sbin/sshd, -t] - | node_name="agent-$(cut -c1-8 /proc/sys/kernel/random/uuid)" printf '%s\n' "$node_name" > /target/etc/hostname sed -i "s/ubuntu-agent/$node_name/g" /target/etc/hosts updates: security shutdown: reboot