From 17a32b701d2d790480909710a259540e1e00a13c Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 3 Apr 2019 23:44:53 +0200 Subject: [PATCH] Chroot: small fix for printf and create /root/.ssh --- debian/chroot.install | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/chroot.install b/debian/chroot.install index 1284f16..999a694 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -255,15 +255,16 @@ chroot /target update-grub sed -i 's/\(^\|^\#\)\(PermitRootLogin\).*/\2 yes/g' /target/etc/ssh/sshd_config ### Add current authorized_keys from the rescue system if present if [ -f /root/.ssh/authorized_keys ]; then - cp /root/.ssh/authorized_keys /target/root/.ssh/authorized_keys + mkdir -p -- /target/root/.ssh/authorized_keys + cp -- /root/.ssh/authorized_keys /target/root/.ssh/authorized_keys else - printf '%b\\n' "${REDB}You might want to define an authorized key for SSH/root in /target/etc/ssh/sshd_config${RESET}" + printf '%b\n' "${REDB}You might want to define an authorized key for SSH/root in /target/etc/ssh/sshd_config${RESET}" fi ## }}} -printf '%b\\n' "${REDB}Please change the root's password :${RESET}" +printf '%b\n' "${REDB}Please change the root's password :${RESET}" chroot /target passwd -printf '%b\\n' "${GREEN}The system is still available on /target but you can now try to reboot the hardware." +printf '%b\n' "${GREEN}The system is still available on /target but you can now try to reboot the hardware.${RESET}" exit 0 # }}}