From 7f0f01ca5b63ed10b095a9355d511eaf47f98b25 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Fri, 24 Mar 2023 10:52:56 +0100 Subject: [PATCH 1/2] Ship systemd config file for sshpassword support The sshpassword commandline parameter is documented in doc/ but is implemented in this file which was not shipped as part of the installer itself. Signed-off-by: Yann Dirson --- Makefile | 2 ++ startup/sshd_installer.conf | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 startup/sshd_installer.conf diff --git a/Makefile b/Makefile index e5551280..4683cf6c 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ install: $(DESTDIR)/etc/modprobe.d \ $(DESTDIR)/etc/modules-load.d \ $(DESTDIR)/etc/dracut.conf.d \ + $(DESTDIR)/etc/systemd/system/sshd.service.d \ $(DESTDIR)/etc/systemd/system/systemd-udevd.d $(INSTALL) -m755 startup/interface-rename-sideway $(DESTDIR)/$(INSTALLER_DIR) @@ -72,6 +73,7 @@ install: $(INSTALL) -m755 startup/preinit startup/S05ramdisk $(DESTDIR)/$(INSTALLER_DIR)/ $(INSTALL) -m644 startup/systemd-udevd_depmod.conf $(DESTDIR)/etc/systemd/system/systemd-udevd.d/installer.conf $(INSTALL) -m644 startup/interface-rename-sideway.service $(DESTDIR)/$(SERVICE_DIR) + $(INSTALL) -m644 startup/sshd_installer.conf $(DESTDIR)/etc/systemd/system/sshd.service.d/ # Generate a multipath configuration from sm's copy, removing # the blacklist and blacklist_exception sections. diff --git a/startup/sshd_installer.conf b/startup/sshd_installer.conf new file mode 100644 index 00000000..a68ce22f --- /dev/null +++ b/startup/sshd_installer.conf @@ -0,0 +1,5 @@ +[Unit] +ConditionKernelCommandLine=sshpassword + +[Service] +ExecStartPre=/bin/sh -c '/bin/sed -e "s/.*sshpassword=\([^ ]*\).*/root:\1/" /proc/cmdline | /sbin/chpasswd' From ec6388fc7ce52d6c11256d4f2199f9e8e7cd723a Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Fri, 8 Dec 2023 11:24:12 +0100 Subject: [PATCH 2/2] sshd_installer.conf: be more strict on sshpassword= identification Suggested-by: Frediano Ziglio Signed-off-by: Yann Dirson --- startup/sshd_installer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup/sshd_installer.conf b/startup/sshd_installer.conf index a68ce22f..70b57ea3 100644 --- a/startup/sshd_installer.conf +++ b/startup/sshd_installer.conf @@ -2,4 +2,4 @@ ConditionKernelCommandLine=sshpassword [Service] -ExecStartPre=/bin/sh -c '/bin/sed -e "s/.*sshpassword=\([^ ]*\).*/root:\1/" /proc/cmdline | /sbin/chpasswd' +ExecStartPre=/bin/sh -c '/bin/sed -e "s/.*\