From 86fa03cbf3d3f88846c6451fb04dd328a91a1508 Mon Sep 17 00:00:00 2001 From: miampf Date: Thu, 5 Dec 2024 15:23:27 +0100 Subject: [PATCH] `sshd` config and creation of `create-host-ssh-key` service --- image/base/mkosi.skeleton/etc/ssh/sshd_config | 1 + .../usr/lib/systemd/system/create-host-ssh-key.service | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 image/base/mkosi.skeleton/etc/ssh/sshd_config create mode 100644 image/base/mkosi.skeleton/usr/lib/systemd/system/create-host-ssh-key.service diff --git a/image/base/mkosi.skeleton/etc/ssh/sshd_config b/image/base/mkosi.skeleton/etc/ssh/sshd_config new file mode 100644 index 000000000..4e298496b --- /dev/null +++ b/image/base/mkosi.skeleton/etc/ssh/sshd_config @@ -0,0 +1 @@ +HostKey /run/ssh_host_ecdsa_key diff --git a/image/base/mkosi.skeleton/usr/lib/systemd/system/create-host-ssh-key.service b/image/base/mkosi.skeleton/usr/lib/systemd/system/create-host-ssh-key.service new file mode 100644 index 000000000..084568705 --- /dev/null +++ b/image/base/mkosi.skeleton/usr/lib/systemd/system/create-host-ssh-key.service @@ -0,0 +1,10 @@ +[Unit] +Description=Create a host SSH key +Before=sshd.service + +[Service] +Type=oneshot +ExecStart=ssh-keygen -t ecdsa -q -N "" /run/ssh_host_ecdsa_key + +[Install] +WantedBy=multi-user.target