This commit is contained in:
Bohan Yang
2021-01-10 07:25:12 +00:00
committed by GitHub
parent 3e448b3081
commit ea769da983
+17 -3
View File
@@ -35,8 +35,16 @@ sshd_conf() {
} }
prompt_password() { prompt_password() {
local prompt=
if [ $# -gt 0 ]; then
prompt=$1
elif [ "$username" = root ]; then
prompt="Choose a password for the root user: "
else
prompt="Choose a password for user $username: "
fi
stty -echo stty -echo
echo -n "Choose a password for the new user $username: " > /dev/tty echo -n "$prompt" > /dev/tty
read -r password < /dev/tty read -r password < /dev/tty
stty echo stty echo
echo > /dev/tty echo > /dev/tty
@@ -250,9 +258,15 @@ done
installer="debian-$suite" installer="debian-$suite"
installer_directory="/boot/$installer" installer_directory="/boot/$installer"
while [ -z "$password" ]; do if [ "$skip_account_setup" = false ]; then
while [ -z "$password" ]; do
prompt_password prompt_password
done done
elif [ "$network_console" = true ] && [ -z "$authorized_keys_url" ]; then
while [ -z "$password" ]; do
prompt_password "Choose a password for the installer user of the SSH network console: "
done
fi
save_preseed='cat' save_preseed='cat'
if [ "$dry_run" != true ]; then if [ "$dry_run" != true ]; then