Reset SSH-port of host-machines to 1022

I want to use port 22 for my git-server, therefore I have to make this
port free for use of kubernetes. This change allows this, so when I want
to connect to the host-machines I'll use port 1022.
This commit is contained in:
2025-09-17 00:50:26 +02:00
parent 1b32fb309c
commit 75a485fbff
6 changed files with 16 additions and 2 deletions

View File

@@ -5,6 +5,10 @@ users:
- name: cluster
shell: /bin/bash
runcmd:
# setup ssh over port 1022 instead of 22
- sed -i /etc/ssh/sshd_config -e 's/^#\{,1\}\( *Port\) [0-9]\+$/\1 1022/'
- systemctl daemon-reload
- systemctl restart ssh.socket
# configure correct routing via NAT
- ip route add default via ${network_gateway}
- NIC=$(ifconfig | grep -q enp7s0 && echo enp7s0 || echo ens10)

View File

@@ -5,6 +5,10 @@ users:
- name: cluster
shell: /bin/bash
runcmd:
# setup ssh over port 1022 instead of 22
- sed -i /etc/ssh/sshd_config -e 's/^#\{,1\}\( *Port\) [0-9]\+$/\1 1022/'
- systemctl daemon-reload
- systemctl restart ssh.socket
# configure NAT
- echo '#!/bin/bash' > /etc/networkd-dispatcher/routable.d/10-eth0-post-up
- echo 'echo 1 > /proc/sys/net/ipv4/ip_forward' >> /etc/networkd-dispatcher/routable.d/10-eth0-post-up