File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -487,11 +487,13 @@ function install_distribution_agnostic() {
487487 echo " nameserver $NAMESERVER " > " ${SDCARD} " /etc/resolvconf/resolv.conf.d/head
488488 fi
489489
490- # permit root login via SSH for the first boot
491- sed -i ' s/#\?PermitRootLogin .*/PermitRootLogin yes/' " ${SDCARD} " /etc/ssh/sshd_config
492-
493- # enable PubkeyAuthentication
494- sed -i ' s/#\?PubkeyAuthentication .*/PubkeyAuthentication yes/' " ${SDCARD} " /etc/ssh/sshd_config
490+ # don't fail if OpenSSH is missing, e.g. if dropbear is installed instead
491+ if [[ -f " ${SDCARD} " /etc/ssh/sshd_config ]]; then
492+ # permit root login via SSH for the first boot
493+ sed -i ' s/#\?PermitRootLogin .*/PermitRootLogin yes/' " ${SDCARD} " /etc/ssh/sshd_config
494+ # enable PubkeyAuthentication
495+ sed -i ' s/#\?PubkeyAuthentication .*/PubkeyAuthentication yes/' " ${SDCARD} " /etc/ssh/sshd_config
496+ fi
495497
496498 # avahi daemon defaults if exists
497499 [[ -f " ${SDCARD} " /usr/share/doc/avahi-daemon/examples/sftp-ssh.service ]] &&
You can’t perform that action at this time.
0 commit comments