preconfigure authorized ssh key

This commit is contained in:
Gwenhael Le Moine 2018-09-09 16:45:14 +02:00
parent eba1f84632
commit 98007e1b61
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -25,6 +25,7 @@ LINUX_VERSION=${LINUX_VERSION:-"latest"}
SLACKWARE_VERSION=${SLACKWARE_VERSION:-"current"}
SLACKWARE_MINIROOTFS_VERSION=${SLACKWARE_MINIROOTFS_VERSION:-"30Aug18"}
SSH_PUB_KEY=${SSH_PUB_KEY:-~/.ssh/id_ed25519.pub}
echo "Going further will wipe ${SD_DEV} and you _will_ lose all data on it !"
echo "/!\\ LAST CHANCE TO HIT Ctrl-C /!\\"
@ -75,6 +76,9 @@ EOF
cp $CWD/pine64-kernel.SlackBuild $SD_MOUNT_POINT/root
mkdir -p $SD_MOUNT_POINT/root/.ssh/
cp $SSH_PUB_KEY $SD_MOUNT_POINT/root/.ssh/authorized_keys
umount $SD_MOUNT_POINT/bootenv
umount $SD_MOUNT_POINT
sync