diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 476ffc9..ea30818 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,9 @@ jobs: env: BASE_SIGN: "${{ matrix.platform }}-${{ matrix.case_suffix }}" + DOCKER_HIGHLOAD_FLAGS: >- + --init + steps: - name: Prepare variables run: | @@ -170,6 +173,7 @@ jobs: # "- sleep infinity" is a right command. Docker ignores "-" and runs "sleep infinity". # docker run -d -t \ + ${{ env.DOCKER_HIGHLOAD_FLAGS }} \ --network ${{ env.RUN_CFG__NETWORK_NAME }} \ --name ${{ env.RUN_CFG__MACHINE2_NAME }} \ "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \ @@ -217,6 +221,7 @@ jobs: # Pass environment variables so Python tests know where to start. # Added the --rm flag so that the container is automatically deleted after the tests are completed docker run --rm -t \ + ${{ env.DOCKER_HIGHLOAD_FLAGS }} \ --network ${{ env.RUN_CFG__NETWORK_NAME }} \ --name ${{ env.RUN_CFG__MACHINE1_NAME }} \ -v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \ diff --git a/Dockerfile--alpine.tmpl b/Dockerfile--alpine.tmpl index 651770f..5c40828 100644 --- a/Dockerfile--alpine.tmpl +++ b/Dockerfile--alpine.tmpl @@ -13,6 +13,10 @@ RUN apk add --no-cache \ sudo \ git +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + ENV PYTHON_BINARY=python3 # --------------------------------------------- base2 @@ -43,7 +47,16 @@ RUN echo "test:*" | chpasswd -e RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + # echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # # \"$@\" @@ -69,11 +82,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ -su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ diff --git a/Dockerfile--altlinux_10.tmpl b/Dockerfile--altlinux_10.tmpl index afde673..bd28dc3 100644 --- a/Dockerfile--altlinux_10.tmpl +++ b/Dockerfile--altlinux_10.tmpl @@ -15,6 +15,10 @@ RUN apt-get update && apt-get install -y \ git \ && apt-get clean +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/openssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/openssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/openssh/sshd_config + # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 @@ -36,13 +40,6 @@ RUN adduser test -G wheel # It enables execution of "sudo service ssh start" without password RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers -# -# Altlinux 10 and 11 too slowly create a new SSH connection (x6). -# -# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS) -# -RUN echo "UseDNS no" >> /etc/openssh/sshd_config - COPY --chown=test:test . /home/test/testgres WORKDIR /home/test/testgres @@ -50,7 +47,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # # \"$@\" @@ -60,7 +66,7 @@ RUN chmod 700 /home/test/ && \ ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ - /usr/sbin/sshd; \ + (ulimit -n 1024 && /usr/sbin/sshd); \ ls -la /home/test/.ssh/; \ \"$@\" \ ", "DUMMY-DUMMY-DUMMY"] @@ -76,11 +82,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ -su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ diff --git a/Dockerfile--altlinux_11.tmpl b/Dockerfile--altlinux_11.tmpl index 9d07970..3d63d51 100644 --- a/Dockerfile--altlinux_11.tmpl +++ b/Dockerfile--altlinux_11.tmpl @@ -16,6 +16,10 @@ RUN apt-get update && apt-get install -y \ procps \ && apt-get clean +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/openssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/openssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/openssh/sshd_config + # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 @@ -37,13 +41,6 @@ RUN adduser test -G wheel # It enables execution of "sudo service ssh start" without password RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers -# -# Altlinux 10 and 11 too slowly create a new SSH connection (x6). -# -# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS) -# -RUN echo "UseDNS no" >> /etc/openssh/sshd_config - COPY --chown=test:test . /home/test/testgres WORKDIR /home/test/testgres @@ -51,7 +48,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # # \"$@\" @@ -61,7 +67,7 @@ RUN chmod 700 /home/test/ && \ ENTRYPOINT ["sh", "-c", " \ set -eux; \ echo 'SYSTEM START: PREPARING SSH'; \ - /usr/sbin/sshd; \ + (ulimit -n 1024 && /usr/sbin/sshd); \ ls -la /home/test/.ssh/; \ \"$@\" \ ", "DUMMY-DUMMY-DUMMY"] @@ -77,11 +83,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \ -su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ diff --git a/Dockerfile--astralinux_1_7.tmpl b/Dockerfile--astralinux_1_7.tmpl index 0ddf6b8..46e47b0 100644 --- a/Dockerfile--astralinux_1_7.tmpl +++ b/Dockerfile--astralinux_1_7.tmpl @@ -15,6 +15,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && rm -rf /var/lib/apt/lists/* +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 @@ -51,7 +55,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # # \"$@\" @@ -77,11 +90,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ -su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ diff --git a/Dockerfile--rockylinux_10.tmpl b/Dockerfile--rockylinux_10.tmpl index b3a13fa..ed1d068 100644 --- a/Dockerfile--rockylinux_10.tmpl +++ b/Dockerfile--rockylinux_10.tmpl @@ -15,7 +15,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \ # Consolidating system utilities, including iproute (to prevent tests from failing) # Added the --allowerasing flag so dnf can seamlessly replace curl-minimal with full-fledged curl -RUN dnf install -y --allowerasing \ +RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \ sudo \ curl \ ca-certificates \ @@ -29,6 +29,10 @@ RUN dnf install -y --allowerasing \ git \ && dnf clean all +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + # In RHEL 9/10, to generate host keys inside Docker, you need to call this binary RUN /usr/libexec/openssh/sshd-keygen rsa && \ /usr/libexec/openssh/sshd-keygen ed25519 @@ -37,7 +41,7 @@ RUN /usr/libexec/openssh/sshd-keygen rsa && \ FROM base1 AS base2_with_python-3 # Rocky 9/10 installs python3.9 or higher (depending on the repository) -RUN dnf install -y \ +RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \ python3 \ python3-devel \ && dnf clean all @@ -67,7 +71,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # Our ENTRYPOINT with a stub ENTRYPOINT ["sh", "-c", " \ @@ -90,11 +103,6 @@ if [ ! -f /home/test/.ssh/id_ed25519 ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ -su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ diff --git a/Dockerfile--rockylinux_8.tmpl b/Dockerfile--rockylinux_8.tmpl index e658566..4787f66 100644 --- a/Dockerfile--rockylinux_8.tmpl +++ b/Dockerfile--rockylinux_8.tmpl @@ -15,7 +15,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \ dnf config-manager --set-enabled powertools # Combine the installation of system utilities, SSH into one layer -RUN dnf install -y \ +RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 \ sudo \ curl \ ca-certificates \ @@ -29,10 +29,14 @@ RUN dnf install -y \ iproute \ && dnf clean all +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 -RUN dnf install -y \ +RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 \ python39 \ python39-devel \ && dnf clean all diff --git a/Dockerfile--rockylinux_9.tmpl b/Dockerfile--rockylinux_9.tmpl index a65468d..88b0559 100644 --- a/Dockerfile--rockylinux_9.tmpl +++ b/Dockerfile--rockylinux_9.tmpl @@ -15,7 +15,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \ # Consolidating system utilities, including iproute (to prevent tests from failing) # Added the --allowerasing flag so dnf can seamlessly replace curl-minimal with full-fledged curl -RUN dnf install -y --allowerasing \ +RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \ sudo \ curl \ ca-certificates \ @@ -29,6 +29,10 @@ RUN dnf install -y --allowerasing \ git \ && dnf clean all +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + # In RHEL 9/10, to generate host keys inside Docker, you need to call this binary RUN /usr/libexec/openssh/sshd-keygen rsa && \ /usr/libexec/openssh/sshd-keygen ed25519 @@ -37,7 +41,7 @@ RUN /usr/libexec/openssh/sshd-keygen rsa && \ FROM base1 AS base2_with_python-3 # Rocky 9/10 installs python3.9 or higher (depending on the repository) -RUN dnf install -y \ +RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \ python3 \ python3-devel \ && dnf clean all @@ -67,7 +71,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # Our ENTRYPOINT with a stub ENTRYPOINT ["sh", "-c", " \ @@ -90,11 +103,6 @@ if [ ! -f /home/test/.ssh/id_ed25519 ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ -su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ diff --git a/Dockerfile--ubuntu_24_04.tmpl b/Dockerfile--ubuntu_24_04.tmpl index ad3f5e7..e909924 100644 --- a/Dockerfile--ubuntu_24_04.tmpl +++ b/Dockerfile--ubuntu_24_04.tmpl @@ -18,6 +18,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ git \ && rm -rf /var/lib/apt/lists/* +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 @@ -47,7 +51,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # # \"$@\" @@ -73,11 +86,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ -su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ diff --git a/Dockerfile--ubuntu_26_04.tmpl b/Dockerfile--ubuntu_26_04.tmpl index eecf24f..3241d3e 100644 --- a/Dockerfile--ubuntu_26_04.tmpl +++ b/Dockerfile--ubuntu_26_04.tmpl @@ -23,6 +23,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get install -y --allow-remove-essential coreutils-from-gnu coreutils-from-uutils- \ && rm -rf /var/lib/apt/lists/* +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + # --------------------------------------------- base2_with_python-3 FROM base1 AS base2_with_python-3 @@ -82,7 +86,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # # \"$@\" @@ -108,11 +121,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ -su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \