From 0d94d9a7129719b4151f3e19dae62d175abebc07 Mon Sep 17 00:00:00 2001 From: Stavros Date: Thu, 5 Sep 2024 14:31:47 +0300 Subject: [PATCH] refactor(dockerfiles): make sure password auth is enabled --- dockerfiles/Dockerfile.almalinux | 2 +- dockerfiles/Dockerfile.alpine | 2 +- dockerfiles/Dockerfile.amazonlinux | 2 +- dockerfiles/Dockerfile.archlinux | 2 +- dockerfiles/Dockerfile.debian | 2 +- dockerfiles/Dockerfile.fedora | 2 +- dockerfiles/Dockerfile.oraclelinux | 2 +- dockerfiles/Dockerfile.rockylinux | 2 +- dockerfiles/Dockerfile.ubuntu | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dockerfiles/Dockerfile.almalinux b/dockerfiles/Dockerfile.almalinux index 9a14618..981b4bf 100644 --- a/dockerfiles/Dockerfile.almalinux +++ b/dockerfiles/Dockerfile.almalinux @@ -8,7 +8,7 @@ RUN echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo RUN adduser almalinux RUN usermod -aG sudo almalinux -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.alpine b/dockerfiles/Dockerfile.alpine index 35bce4e..089bd9a 100644 --- a/dockerfiles/Dockerfile.alpine +++ b/dockerfiles/Dockerfile.alpine @@ -8,7 +8,7 @@ RUN echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo RUN adduser -D alpine RUN addgroup alpine sudo -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.amazonlinux b/dockerfiles/Dockerfile.amazonlinux index b1197d9..d0b15a7 100644 --- a/dockerfiles/Dockerfile.amazonlinux +++ b/dockerfiles/Dockerfile.amazonlinux @@ -8,7 +8,7 @@ RUN echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo RUN adduser amazonlinux RUN usermod -aG sudo amazonlinux -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.archlinux b/dockerfiles/Dockerfile.archlinux index cef4d7d..e627937 100644 --- a/dockerfiles/Dockerfile.archlinux +++ b/dockerfiles/Dockerfile.archlinux @@ -8,7 +8,7 @@ RUN echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers RUN useradd archlinux RUN usermod -aG sudo archlinux -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.debian b/dockerfiles/Dockerfile.debian index 006cd2c..66de16f 100644 --- a/dockerfiles/Dockerfile.debian +++ b/dockerfiles/Dockerfile.debian @@ -5,7 +5,7 @@ RUN apt update && apt install openssh-server sudo passwd -y RUN adduser debian RUN usermod -aG sudo debian -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.fedora b/dockerfiles/Dockerfile.fedora index 51b5e60..463d22b 100644 --- a/dockerfiles/Dockerfile.fedora +++ b/dockerfiles/Dockerfile.fedora @@ -8,7 +8,7 @@ RUN echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo RUN adduser fedora RUN usermod -aG sudo fedora -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.oraclelinux b/dockerfiles/Dockerfile.oraclelinux index 02c2b37..0f9ca3d 100644 --- a/dockerfiles/Dockerfile.oraclelinux +++ b/dockerfiles/Dockerfile.oraclelinux @@ -8,7 +8,7 @@ RUN echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo RUN adduser oraclelinux RUN usermod -aG sudo oraclelinux -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.rockylinux b/dockerfiles/Dockerfile.rockylinux index 48a3212..bab3509 100644 --- a/dockerfiles/Dockerfile.rockylinux +++ b/dockerfiles/Dockerfile.rockylinux @@ -8,7 +8,7 @@ RUN echo '%sudo ALL=(ALL:ALL) ALL' > /etc/sudoers.d/sudo RUN adduser rockylinux RUN usermod -aG sudo rockylinux -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A diff --git a/dockerfiles/Dockerfile.ubuntu b/dockerfiles/Dockerfile.ubuntu index 1a07dfe..fefdeea 100644 --- a/dockerfiles/Dockerfile.ubuntu +++ b/dockerfiles/Dockerfile.ubuntu @@ -5,7 +5,7 @@ RUN apt update && apt install openssh-server sudo passwd -y RUN adduser ubuntu RUN usermod -aG sudo ubuntu -RUN echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config +RUN sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config RUN mkdir -p /run/sshd RUN ssh-keygen -A