Skip to content

Commit b1d06bd

Browse files
committed
Use pki for ssh access
1 parent bf19558 commit b1d06bd

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

mkosi.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Format=disk
2929
SplitArtifacts=yes
3030

3131
[Content]
32-
RootPassword=foobar
3332
Locale=en_US.UTF-8
3433
Keymap=fi
3534
Timezone=Europe/Helsinki

mkosi.extra/usr/lib/systemd/system-generators/import-ssh-public-key-from-eeprom

Lines changed: 0 additions & 22 deletions
This file was deleted.

mkosi.finalize

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
#!/bin/bash -ex
1+
#!/bin/bash -e
22

33
kver=$(basename $BUILDROOT/usr/lib/modules/*)
44
if zcat -t $BUILDROOT/usr/lib/modules/$kver/vmlinuz ; then
55
mv $BUILDROOT/usr/lib/modules/$kver/{vmlinuz,vmlinuz.gz}
66
gzip -d $BUILDROOT/usr/lib/modules/$kver/vmlinuz.gz
77
fi
8+
9+
mkdir -pm 0700 /root/.ssh
10+
# todo: use $(jq -r '.SshKey' $MKOSI_CONFIG) instead of hardcoded mkosi.key once the fix is released https://github.com/systemd/mkosi/pull/2574
11+
ssh-keygen -f $SRCDIR/mkosi.key -y > /root/.ssh/authorized_keys
12+
chmod 0700 /root/.ssh/authorized_keys

0 commit comments

Comments
 (0)