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.
This commit is contained in:
Dave Loyall 2019-10-22 16:51:34 -05:00 committed by GitHub
parent 762a252676
commit f7cd895bfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ case $1 in
echo "adding new user $1" echo "adding new user $1"
newpw=$(pwgen -1B 10) 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 \ sudo useradd -m -g 100 -p "$pwcrypt" -s /bin/bash $1 \
|| error_exit "couldn't add user" || error_exit "couldn't add user"