From b43e8319f4655ccef463100f198e45c30401c27b Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Thu, 2 Jan 2025 12:57:31 -0600 Subject: [PATCH] systemd: sshd: Disable ssh-keygen The default _sshd.service_ unit runs `ssh-keygen -A` in `ExecStartPre`, to ensure host keys exist before starting the SSH daemon. Unfortunately, this tool does _not_ respect the `HostKey` settings in `sshd_config`, and unconditionally tries to create the key files in `/etc/ssh`. Since this directory is not writable, the command fails, preventing the SSH daemon from starting. --- overlay/usr/lib/systemd/sshd.service.d/no-keygen.conf | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 overlay/usr/lib/systemd/sshd.service.d/no-keygen.conf diff --git a/overlay/usr/lib/systemd/sshd.service.d/no-keygen.conf b/overlay/usr/lib/systemd/sshd.service.d/no-keygen.conf new file mode 100644 index 0000000..76864e2 --- /dev/null +++ b/overlay/usr/lib/systemd/sshd.service.d/no-keygen.conf @@ -0,0 +1,2 @@ +[Service] +ExecStartPre=