From d5974cdbd2eb3261d6641f6426575d894a830292 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sat, 1 Jun 2024 16:53:18 +0200 Subject: [PATCH] fix errors on local image --- usr/lib/archboot/cpio/hooks/remote | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/lib/archboot/cpio/hooks/remote b/usr/lib/archboot/cpio/hooks/remote index 9741deee0..1f24be68e 100644 --- a/usr/lib/archboot/cpio/hooks/remote +++ b/usr/lib/archboot/cpio/hooks/remote @@ -12,13 +12,15 @@ _run () /usr/lib/ssh/{sftp-server,ssh-keysign,ssh-pkcs11-helper} mkdir -p "${_ROOTFS}"/root/.ssh # add ssh key - _file_rename /etc/archboot/ssh/archboot-key.pub /root/.ssh/authorized_keys if [[ -f /etc/archboot/ssh/archboot-key ]]; then _file_rename /etc/archboot/ssh/archboot-key /root/.ssh/archboot-key _file /etc/archboot/ssh/archboot-key fi - _file_rename /etc/archboot/ssh/archboot-key.pub /root/.ssh/archboot-key.pub - _file /etc/archboot/ssh/archboot-key.pub + if [[ -f /etc/archboot/ssh/archboot-key.pub ]]; then + _file_rename /etc/archboot/ssh/archboot-key.pub /root/.ssh/authorized_keys + _file_rename /etc/archboot/ssh/archboot-key.pub /root/.ssh/archboot-key.pub + _file /etc/archboot/ssh/archboot-key.pub + fi # switch port to ARCH and disable password login _file_rename /etc/ssh/sshd_config /etc/ssh/sshd_config echo "Port 11838" >> ${_ROOTFS}/etc/ssh/sshd_config