diff --git a/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_logindefs/tests/default_yescrypt.pass.sh b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_logindefs/tests/default_yescrypt.pass.sh new file mode 100644 index 00000000000..dff8684b0bb --- /dev/null +++ b/linux_os/guide/system/accounts/accounts-pam/set_password_hashing_algorithm/set_password_hashing_algorithm_logindefs/tests/default_yescrypt.pass.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# variables = var_password_hashing_algorithm=YESCRYPT + +# Make sure ENCRYPT_METHOD is YESCRYPT +if grep -q "^ENCRYPT_METHOD" /etc/login.defs; then + sed -i "s/^ENCRYPT_METHOD\b.*/ENCRYPT_METHOD YESCRYPT/" /etc/login.defs +else + echo "ENCRYPT_METHOD YESCRYPT" >> /etc/login.defs +fi