set user password with passwd, chpasswd does not work for some reason
This commit is contained in:
parent
a2ad37d096
commit
4b93866392
@ -181,14 +181,14 @@ set_user() {
|
||||
user_name="$(get_value "user_name" "username")"
|
||||
|
||||
local user_pw
|
||||
user_pw="$(get_value "user_pw" "user password")"
|
||||
user_pw="$(get_value "user_pw" "user password" 1)"
|
||||
|
||||
chroot /mnt /bin/env -i \
|
||||
user_name="$user_name" \
|
||||
user_pw="$user_pw" \
|
||||
/bin/bash <<"EOT"
|
||||
useradd --groups wheel --create-home --shell /bin/bash --user-group $user_name
|
||||
echo "$user_name:$user_pw" | chpasswd
|
||||
echo -e "$user_pw\n$user_pw" | passwd "$user_name"
|
||||
EOT
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user