From 1a0578c541f30e23dc16cccb50c80cf2448d0b5d Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Thu, 17 Oct 2024 17:20:46 +0000 Subject: [PATCH] fix(qemu images): set sshd UseDNS=no --- tools/qemu-centos-img/6/Dockerfile | 2 ++ tools/qemu-centos-img/7/Dockerfile | 2 ++ tools/qemu-centos-img/8/Dockerfile | 2 ++ tools/qemu-debian-img/setup.sh | 2 ++ tools/qemu-oraclelinux-img/Dockerfile.template | 2 ++ tools/qemu-ubuntu-img/14.04/setup.sh | 2 ++ tools/qemu-ubuntu-img/setup.sh | 2 ++ 7 files changed, 14 insertions(+) diff --git a/tools/qemu-centos-img/6/Dockerfile b/tools/qemu-centos-img/6/Dockerfile index b653d59..576a9d4 100644 --- a/tools/qemu-centos-img/6/Dockerfile +++ b/tools/qemu-centos-img/6/Dockerfile @@ -28,6 +28,8 @@ RUN sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config RUN sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config +RUN sed -i '/UseDNS/d' $TMPDIR/etc/ssh/sshd_config +RUN echo UseDNS no >> $TMPDIR/etc/ssh/sshd_config # network workaround RUN chmod +x $TMPDIR/etc/rc.local diff --git a/tools/qemu-centos-img/7/Dockerfile b/tools/qemu-centos-img/7/Dockerfile index a3ebcd0..cd34990 100644 --- a/tools/qemu-centos-img/7/Dockerfile +++ b/tools/qemu-centos-img/7/Dockerfile @@ -37,6 +37,8 @@ RUN sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config RUN sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config +RUN sed -i '/UseDNS/d' $TMPDIR/etc/ssh/sshd_config +RUN echo UseDNS no >> $TMPDIR/etc/ssh/sshd_config # network workaround RUN chmod +x $TMPDIR/etc/rc.local diff --git a/tools/qemu-centos-img/8/Dockerfile b/tools/qemu-centos-img/8/Dockerfile index adb8c88..57de71a 100644 --- a/tools/qemu-centos-img/8/Dockerfile +++ b/tools/qemu-centos-img/8/Dockerfile @@ -28,6 +28,8 @@ RUN sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config RUN sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config +RUN sed -i '/UseDNS/d' $TMPDIR/etc/ssh/sshd_config +RUN echo UseDNS no >> $TMPDIR/etc/ssh/sshd_config # network workaround RUN chmod +x $TMPDIR/etc/rc.local diff --git a/tools/qemu-debian-img/setup.sh b/tools/qemu-debian-img/setup.sh index 03624d3..83616d9 100755 --- a/tools/qemu-debian-img/setup.sh +++ b/tools/qemu-debian-img/setup.sh @@ -11,6 +11,8 @@ sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config +sed -i '/UseDNS/d' $TMPDIR/etc/ssh/sshd_config +echo UseDNS no >> $TMPDIR/etc/ssh/sshd_config echo '#!/bin/sh' > $TMPDIR/etc/rc.local echo 'dhclient' >> $TMPDIR/etc/rc.local diff --git a/tools/qemu-oraclelinux-img/Dockerfile.template b/tools/qemu-oraclelinux-img/Dockerfile.template index 2c7c4d2..b4485ab 100644 --- a/tools/qemu-oraclelinux-img/Dockerfile.template +++ b/tools/qemu-oraclelinux-img/Dockerfile.template @@ -30,6 +30,8 @@ RUN sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config RUN sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config RUN echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config +RUN sed -i '/UseDNS/d' $TMPDIR/etc/ssh/sshd_config +RUN echo UseDNS no >> $TMPDIR/etc/ssh/sshd_config # network workaround RUN chmod +x $TMPDIR/etc/rc.local diff --git a/tools/qemu-ubuntu-img/14.04/setup.sh b/tools/qemu-ubuntu-img/14.04/setup.sh index 0575a78..b4a1647 100755 --- a/tools/qemu-ubuntu-img/14.04/setup.sh +++ b/tools/qemu-ubuntu-img/14.04/setup.sh @@ -11,6 +11,8 @@ sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config +sed -i '/UseDNS/d' $TMPDIR/etc/ssh/sshd_config +echo UseDNS no >> $TMPDIR/etc/ssh/sshd_config echo '#!/bin/sh' > $TMPDIR/etc/rc.local echo 'dhclient eth0' >> $TMPDIR/etc/rc.local diff --git a/tools/qemu-ubuntu-img/setup.sh b/tools/qemu-ubuntu-img/setup.sh index 03c2b4e..1483406 100755 --- a/tools/qemu-ubuntu-img/setup.sh +++ b/tools/qemu-ubuntu-img/setup.sh @@ -11,6 +11,8 @@ sed -i '/PermitEmptyPasswords/d' $TMPDIR/etc/ssh/sshd_config echo PermitEmptyPasswords yes >> $TMPDIR/etc/ssh/sshd_config sed -i '/PermitRootLogin/d' $TMPDIR/etc/ssh/sshd_config echo PermitRootLogin yes >> $TMPDIR/etc/ssh/sshd_config +sed -i '/UseDNS/d' $TMPDIR/etc/ssh/sshd_config +echo UseDNS no >> $TMPDIR/etc/ssh/sshd_config echo '#!/bin/sh' > $TMPDIR/etc/rc.local echo 'dhclient || dhcpcd' >> $TMPDIR/etc/rc.local