From b574c1f112663525dcc70937a67cc8e4fa200690 Mon Sep 17 00:00:00 2001 From: valentinab25 Date: Tue, 13 Oct 2020 14:54:56 +0300 Subject: [PATCH] improve PasswordAuthentication sed regex --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index ad8eb74..467d0bb 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,7 +7,7 @@ mkdir -p /root/.ssh > /root/.ssh/authorized_keys chmod go-rwx /root/.ssh/authorized_keys -sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/g" /etc/ssh/sshd_config +sed -i "s/.*PasswordAuthentication .*/PasswordAuthentication no/g" /etc/ssh/sshd_config sed -i 's/root:!/root:*/' /etc/shadow # Provide SSH_AUTH_KEY_* via environment variable