From 57203bc50c0d5e8d96ed1aa035641dbb2950fb31 Mon Sep 17 00:00:00 2001 From: Aleksandr Mezin Date: Thu, 26 Dec 2024 13:06:08 +0200 Subject: [PATCH 1/2] Handle multiple public keys correctly --- fedora.ks | 2 +- silverblue.ks | 2 +- ubuntu-22.04-autoinstall.yml | 3 +-- ubuntu-autoinstall.yml | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fedora.ks b/fedora.ks index 7fa080e..cb2d165 100644 --- a/fedora.ks +++ b/fedora.ks @@ -8,7 +8,7 @@ bootloader --location=mbr firstboot --disable autopart user --name=vagrant --groups=wheel --password=vagrant --plaintext -sshkey --username=vagrant "${trimspace(file("${path.root}/keys/vagrant.pub"))}" +${join("\n", formatlist("sshkey --username=vagrant \"%s\"", compact(split("\n", file("${path.root}/keys/vagrant.pub")))))} reboot repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch diff --git a/silverblue.ks b/silverblue.ks index ea778ac..3d52537 100644 --- a/silverblue.ks +++ b/silverblue.ks @@ -8,7 +8,7 @@ bootloader --location=mbr firstboot --disable autopart user --name=vagrant --groups=wheel --password=vagrant --plaintext -sshkey --username=vagrant "${trimspace(file("${path.root}/keys/vagrant.pub"))}" +${join("\n", formatlist("sshkey --username=vagrant \"%s\"", compact(split("\n", file("${path.root}/keys/vagrant.pub")))))} ostreesetup --osname="fedora-silverblue" --remote="fedora" --url="file:///ostree/repo" --ref="fedora/${version}/x86_64/silverblue" --nogpg reboot diff --git a/ubuntu-22.04-autoinstall.yml b/ubuntu-22.04-autoinstall.yml index e64be98..29297d4 100644 --- a/ubuntu-22.04-autoinstall.yml +++ b/ubuntu-22.04-autoinstall.yml @@ -15,8 +15,7 @@ autoinstall: hostname: ${hostname} ssh: install-server: yes - authorized-keys: - - ${trimspace(file("${path.root}/keys/vagrant.pub"))} + authorized-keys: ${format("%#v", compact(split("\n", file("${path.root}/keys/vagrant.pub"))))} allow-pw: yes packages: - ubuntu-desktop diff --git a/ubuntu-autoinstall.yml b/ubuntu-autoinstall.yml index efafc2b..294b172 100644 --- a/ubuntu-autoinstall.yml +++ b/ubuntu-autoinstall.yml @@ -15,8 +15,7 @@ autoinstall: hostname: ${hostname} ssh: install-server: yes - authorized-keys: - - ${trimspace(file("${path.root}/keys/vagrant.pub"))} + authorized-keys: ${format("%#v", compact(split("\n", file("${path.root}/keys/vagrant.pub"))))} allow-pw: yes packages: - qemu-guest-agent From ab28e4b4ec553468f259a579ced8100be48d5ca4 Mon Sep 17 00:00:00 2001 From: Aleksandr Mezin Date: Thu, 26 Dec 2024 01:50:33 +0200 Subject: [PATCH 2/2] Add ed25519 Vagrant SSH public key --- keys/vagrant.pub | 1 + 1 file changed, 1 insertion(+) diff --git a/keys/vagrant.pub b/keys/vagrant.pub index 18a9c00..78a8ccf 100644 --- a/keys/vagrant.pub +++ b/keys/vagrant.pub @@ -1 +1,2 @@ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1YdxBpNlzxDqfJyw/QKow1F+wvG9hXGoqiysfJOn5Y vagrant insecure public key