From f7cd895bfe72e178a2cf7952980dc45a4e21602f Mon Sep 17 00:00:00 2001 From: Dave Loyall Date: Tue, 22 Oct 2019 16:51:34 -0500 Subject: [PATCH] Choose from 4096 different salts instead of 1 The salt is stored in the hash... Quick, look in `/etc/shadow-` ... Is `sa` an unusually common prefix in all those hashes? This PR will fix that. --- makeuser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makeuser b/makeuser index 8f1e5d3..f76d729 100755 --- a/makeuser +++ b/makeuser @@ -37,7 +37,7 @@ case $1 in echo "adding new user $1" newpw=$(pwgen -1B 10) - pwcrypt=$(perl -e "print crypt('${newpw}', 'sa');") + pwcrypt=$(perl -e "print crypt('${newpw}', join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]);") sudo useradd -m -g 100 -p "$pwcrypt" -s /bin/bash $1 \ || error_exit "couldn't add user"