From 0b1c478bd2e806dd29791c77e289b32f30ca48e4 Mon Sep 17 00:00:00 2001 From: Olivier Grand Date: Mon, 10 Jun 2024 11:51:51 +0200 Subject: [PATCH] fix script --- tools/disable_ssh_password_auth.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/disable_ssh_password_auth.sh b/tools/disable_ssh_password_auth.sh index ee53228..1ab9cc7 100755 --- a/tools/disable_ssh_password_auth.sh +++ b/tools/disable_ssh_password_auth.sh @@ -6,6 +6,7 @@ echo "Disabling ssh password authentication..." sed -i 's/^PasswordAuthentication .*/PasswordAuthentication no/g' /etc/ssh/sshd_config -sudo sh -c "echo \"bosh:\$(date +%s | sha256sum | base64 | head -c 32 ; echo\)\" | chpasswd" +pwd="$(echo "bosh:$(date +%s | sha256sum | base64 | head -c 32)")" +sudo sh -c "echo ${pwd} | chpasswd" chage -I -1 -m 0 -M 99999 -E -1 bosh echo "Disabling ssh password authentication done." \ No newline at end of file