Chroot: small fix for printf and create /root/.ssh
This commit is contained in:
parent
166253b508
commit
17a32b701d
|
@ -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
|
||||
# }}}
|
||||
|
|
Loading…
Reference in New Issue