use downloaded authorized_keys

Use the authorized_keys getting downloaded into the temp directory, by
popping out of it later.
This commit is contained in:
June 2025-02-16 23:29:32 +01:00
parent c84cf7b8d0
commit 524c839e2c
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
2 changed files with 1 additions and 3 deletions

View file

@ -24,8 +24,6 @@ If left unset, the respective default value will be used.
`cloud-init` will create a user `chaos`, by default with a locked password, and authorized keys initialized. Password-less `sudo` is configured, so you can run commands as root. `cloud-init` will create a user `chaos`, by default with a locked password, and authorized keys initialized. Password-less `sudo` is configured, so you can run commands as root.
The script expects `authorized_keys` to be in the current directory. Copy the correct contents from the [appropriate repository](https://gitlab.hamburg.ccc.de/ccchh/infrastructure-authorized-keys).
`sshd` has been configured to listen on port 42666 instead of 22. `sshd` has been configured to listen on port 42666 instead of 22.
### Run the Script ### Run the Script

View file

@ -46,7 +46,6 @@ qm destroy ${VMID} || true
qm create ${VMID} --name "creating-vm" --memory 2048 --net0 virtio,bridge=${BRIDGE} qm create ${VMID} --name "creating-vm" --memory 2048 --net0 virtio,bridge=${BRIDGE}
qm importdisk ${VMID} disk.raw ${STORAGE} qm importdisk ${VMID} disk.raw ${STORAGE}
rm disk.raw rm disk.raw
popd
qm set ${VMID} --scsihw virtio-scsi-pci --scsi0 ${STORAGE}:vm-${VMID}-disk-0,ssd=1,discard=on qm set ${VMID} --scsihw virtio-scsi-pci --scsi0 ${STORAGE}:vm-${VMID}-disk-0,ssd=1,discard=on
qm set ${VMID} --ide2 ${STORAGE}:cloudinit qm set ${VMID} --ide2 ${STORAGE}:cloudinit
@ -64,3 +63,4 @@ qm set ${VMID} --ipconfig0 ip=dhcp
qm set ${VMID} --name ${NAME} --tags debian12 qm set ${VMID} --name ${NAME} --tags debian12
qm cloudinit update ${VMID} qm cloudinit update ${VMID}
qm template ${VMID} qm template ${VMID}
popd