Skip to content

Commit 9359f6d

Browse files
Enable SSH_KEY without password (#4523)
1 parent b021a2c commit 9359f6d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

misc/build.func

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,14 @@ advanced_settings() {
702702
exit_script
703703
fi
704704

705-
if [[ "$PW" == -password* ]]; then
706-
if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
705+
SSH_AUTHORIZED_KEY="$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "SSH Authorized key for root (leave empty for none)" 8 58 --title "SSH Key" 3>&1 1>&2 2>&3)"
706+
707+
if [[ -z "${SSH_AUTHORIZED_KEY}" ]]; then
708+
SSH_AUTHORIZED_KEY=""
709+
fi
710+
711+
if [[ "$PW" == -password* || -n "$SSH_AUTHORIZED_KEY" ]]; then
712+
if (whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --defaultno --title "SSH ACCESS" --yesno "Enable Root SSH Access?" 10 58); then
707713
SSH="yes"
708714
else
709715
SSH="no"
@@ -714,15 +720,7 @@ advanced_settings() {
714720
echo -e "${ROOTSSH}${BOLD}${DGN}Root SSH Access: ${BGN}$SSH${CL}"
715721
fi
716722

717-
if [[ "${SSH}" == "yes" ]]; then
718-
SSH_AUTHORIZED_KEY="$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "SSH Authorized key for root (leave empty for none)" 8 58 --title "SSH Key" 3>&1 1>&2 2>&3)"
719723

720-
if [[ -z "${SSH_AUTHORIZED_KEY}" ]]; then
721-
echo "Warning: No SSH key provided."
722-
fi
723-
else
724-
SSH_AUTHORIZED_KEY=""
725-
fi
726724
if (whiptail --backtitle "Proxmox VE Helper Scripts" --defaultno --title "VERBOSE MODE" --yesno "Enable Verbose Mode?" 10 58); then
727725
VERB="yes"
728726
else

0 commit comments

Comments
 (0)