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