Chroot: Just create /root/.ssh dir to copy keys
This commit is contained in:
parent
85275feeea
commit
a5cd62bf0a
|
@ -276,7 +276,7 @@ chroot /target /bin/sh /tmp/latecommand/post.stretch.sh
|
|||
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
|
||||
mkdir -p -- /target/root/.ssh/authorized_keys
|
||||
mkdir -p -- /target/root/.ssh
|
||||
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}"
|
||||
|
|
Loading…
Reference in New Issue