Switched to nftables, modified the default SSH port and removed fail2ban

This commit is contained in:
Héctor Molinero Fernández
2020-06-14 19:49:14 +02:00
parent 1122699107
commit 164b1538f0
7 changed files with 88 additions and 52 deletions

View File

@@ -21,14 +21,14 @@ printf '%s\n' '#cloud-config' 'runcmd: ["ssh-import-id gh:hectorm"]' > "${USERDA
cloud-localds "${USERDATA_DISK:?}" "${USERDATA_YAML:?}"
# Remove keys from the known_hosts file
ssh-keygen -R '[127.0.0.1]:2222'
ssh-keygen -R '[localhost]:2222'
ssh-keygen -R '[127.0.0.1]:1122'
ssh-keygen -R '[localhost]:1122'
# Launch VM
kvm \
-smp 1 -m 512 \
-nographic -serial mon:stdio \
-device e1000,netdev=n0 \
-netdev user,id=n0,hostfwd=tcp::2222-:22,hostfwd=udp::51820-:51820 \
-netdev user,id=n0,hostfwd=tcp::1122-:122,hostfwd=udp::51820-:51820 \
-drive file="${SNAPSHOT_DISK:?}",if=virtio,format=qcow2 \
-drive file="${USERDATA_DISK:?}",if=virtio,format=raw