From 44c51a62e5cd3488bbdef70efd05e0dfe4ea7fc3 Mon Sep 17 00:00:00 2001 From: amorozov Date: Mon, 3 Mar 2025 04:08:14 +0300 Subject: [PATCH] feature: allow to connect as root --- Dockerfile | 2 +- setup-sshd | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4b8b91c..ee38699 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,7 +100,7 @@ RUN apk add --no-cache \ # setup SSH server RUN sed -i /etc/ssh/sshd_config \ - -e 's/#PermitRootLogin.*/PermitRootLogin no/' \ + -e 's/#PermitRootLogin.*/PermitRootLogin yes/' \ -e 's/#PasswordAuthentication.*/PasswordAuthentication no/' \ -e 's/#SyslogFacility.*/SyslogFacility AUTH/' \ -e 's/#LogLevel.*/LogLevel INFO/' \ diff --git a/setup-sshd b/setup-sshd index 2845b10..01d43e8 100644 --- a/setup-sshd +++ b/setup-sshd @@ -43,6 +43,11 @@ write_key() { echo "$1" > "${JENKINS_AGENT_HOME}/.ssh/authorized_keys" chown -Rf "${ID_GROUP}" "${JENKINS_AGENT_HOME}/.ssh" chmod 0700 -R "${JENKINS_AGENT_HOME}/.ssh" + + mkdir -p "/root/.ssh" + echo "$1" > "/root/.ssh/authorized_keys" + chown -Rf "root /root/.ssh" + chmod 0700 -R "/root/.ssh" } if [[ ${JENKINS_AGENT_SSH_PUBKEY} == ssh-* ]]; then