File TEST-74-AUX-UTILS-use-sshd_config.d.patch of Package systemd
From acaf882f401c1d634ac400a611854c33447b9b2f Mon Sep 17 00:00:00 2001
From: val4oss <val4oss@pm.me>
Date: Wed, 1 Oct 2025 17:32:53 +0200
Subject: [PATCH] TEST-74-AUX-UTILS: use sshd_config.d
* From the TEST-74-AUX-UTILS.ssh.sh writting directly into
/etc/ssh/sshd_config can hide config from distro using /usr/etc.
* Using directory configuration /etc/ssh/sshd_config.d/* suits for all
cases.
Signed-off-by: val4oss <val4oss@pm.me>
---
test/units/TEST-74-AUX-UTILS.ssh.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/test/units/TEST-74-AUX-UTILS.ssh.sh b/test/units/TEST-74-AUX-UTILS.ssh.sh
index 890763c9dc..efbe7f628a 100755
--- a/test/units/TEST-74-AUX-UTILS.ssh.sh
+++ b/test/units/TEST-74-AUX-UTILS.ssh.sh
@@ -43,8 +43,13 @@ usermod -U root
mkdir -p /etc/ssh
test -f /etc/ssh/ssh_host_rsa_key || ssh-keygen -t rsa -C '' -N '' -f /etc/ssh/ssh_host_rsa_key
-echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
-echo "LogLevel DEBUG3" >> /etc/ssh/sshd_config
+
+# Use /etc/ssh/sshd_config.d/ to not overwrite sshd config when config is in
+# /usr/etc/ssh/sshd_config
+{
+ echo "PermitRootLogin yes"
+ echo "LogLevel DEBUG3"
+} >/etc/ssh/sshd_config.d/test.conf
test -f /etc/ssh/ssh_config || {
echo 'Include /etc/ssh/ssh_config.d/*.conf'
--
2.51.0