From 8de6abd4bdc1ee1d78b8d9f396a1b36e04979775 Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Sun, 30 Jul 2023 13:52:53 +0200 Subject: [PATCH] sshd on port 42666 instead of 22 --- README.md | 4 +++- build-proxmox-template | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4272691..122f56c 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,14 @@ Verify that the settings at the beginning of the script are suitable to the clus | `NAME` | `chaos-${OS}-tmpl` | name of the template | | `BRIDGE` | `vmbr0,tag=208` | name of the bridge to use and any parameters needed, like the VLAN tag | -### User Account and `authorized_keys` +### User Account, ssh, and `authorized_keys` cloud-init will create a user `chaos`, by default with a locked password, and authorized keys initialized. 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 configure to listen on port 42666 instead of 22. + ### Run the Script ```shell diff --git a/build-proxmox-template b/build-proxmox-template index 7aa504c..7ff971b 100755 --- a/build-proxmox-template +++ b/build-proxmox-template @@ -22,7 +22,8 @@ virt-builder debian-12 -o ${NAME}.qcow2 --format qcow2 \ --run-command 'systemctl enable fstrim.timer' \ --edit '/etc/default/grub:s,GRUB_CMDLINE_LINUX="",GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0",' \ --edit '/etc/default/grub:s,GRUB_TIMEOUT=.*,GRUB_TIMEOUT=1,' \ - --run-command 'update-grub' + --run-command 'update-grub' \ + --edit '/etc/ssh/sshd_config:s,#?Port.*,Port 42666,' \ qm destroy ${VMID} || true qm create ${VMID} --name ${NAME} --memory 1024 --net0 virtio,bridge=${BRIDGE}