From 8e8f77e546a56777cb638fb8c3d7971179bd855c Mon Sep 17 00:00:00 2001 From: cronekorkn Date: Wed, 3 Jul 2024 10:05:44 +0200 Subject: [PATCH] ssh host key: use custom path to not collide with auto generated keys --- bundles/ssh/files/sshd_config | 1 + bundles/ssh/items.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bundles/ssh/files/sshd_config b/bundles/ssh/files/sshd_config index f24ee62..6e30351 100644 --- a/bundles/ssh/files/sshd_config +++ b/bundles/ssh/files/sshd_config @@ -21,3 +21,4 @@ ClientAliveInterval 30 ClientAliveCountMax 5 AcceptEnv LANG Subsystem sftp /usr/lib/openssh/sftp-server +HostKey /etc/ssh/ssh_host_managed_key diff --git a/bundles/ssh/items.py b/bundles/ssh/items.py index 29fb738..cc6d693 100644 --- a/bundles/ssh/items.py +++ b/bundles/ssh/items.py @@ -51,14 +51,14 @@ files = { ], 'skip': dont_touch_sshd, }, - '/etc/ssh/ssh_host_ed25519_key': { + '/etc/ssh/ssh_host_managed_key': { 'content': node.metadata.get('ssh/host_key/private') + '\n', 'mode': '0600', 'triggers': [ 'svc_systemd:ssh:restart' ], }, - '/etc/ssh/ssh_host_ed25519_key.pub': { + '/etc/ssh/ssh_host_managed_key.pub': { 'content': node.metadata.get('ssh/host_key/public') + '\n', 'mode': '0644', 'triggers': [