sshd on port 42666 instead of 22

This commit is contained in:
Stefan Bethke 2023-07-30 13:52:53 +02:00
parent fdfe0cdc03
commit 8de6abd4bd
2 changed files with 5 additions and 2 deletions

View file

@ -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 | | `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 | | `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. 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). 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 ### Run the Script
```shell ```shell

View file

@ -22,7 +22,8 @@ virt-builder debian-12 -o ${NAME}.qcow2 --format qcow2 \
--run-command 'systemctl enable fstrim.timer' \ --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_CMDLINE_LINUX="",GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0",' \
--edit '/etc/default/grub:s,GRUB_TIMEOUT=.*,GRUB_TIMEOUT=1,' \ --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 destroy ${VMID} || true
qm create ${VMID} --name ${NAME} --memory 1024 --net0 virtio,bridge=${BRIDGE} qm create ${VMID} --name ${NAME} --memory 1024 --net0 virtio,bridge=${BRIDGE}