mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-15 11:22:43 +03:00
Add passwd_hash
Without password hash '$user:*' to `chpasswd -e` will result to inability for user to login, or change password. So I've add parameter passwd_hash for the user. Password hash could be generated via command `openssl passwd -5 your_password`.
This commit is contained in:
parent
3e886c87fb
commit
5aece92a41
@ -286,12 +286,16 @@ init__userdata_users() {
|
||||
$MOCK adduser -D ${gecos:+-g "$gecos"} ${homedir:+-h "$homedir"} ${shell:+-s "$shell"} ${primary_group:+-G "$primary_group"} ${system:+-S} ${no_create_home:+-H} "$name"
|
||||
fi
|
||||
|
||||
if in_list hashed_passwd $keys; then
|
||||
hashed_passwd="$(get_userdata users/$i/hashed_passwd)"
|
||||
fi
|
||||
|
||||
if in_list lock_passwd $keys; then
|
||||
lock_passwd="$(get_userdata users/$i/lock_passwd)"
|
||||
fi
|
||||
|
||||
if [ "$lock_passwd" != "false" ]; then
|
||||
echo "$name:*" | $MOCK chpasswd -e
|
||||
echo "${name}:${hashed_passwd}" | $MOCK chpasswd -e
|
||||
fi
|
||||
|
||||
if in_list ssh_authorized_keys $keys; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user