From 2781083521748a41d0237503275795871a88c99a Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Fri, 24 Mar 2023 11:11:20 +0100 Subject: [PATCH] create-installimg: include systemd config for sshpassword support This should indeed be part of host-installer-startup, see https://github.com/xenserver/host-installer/pull/42 Will need to be reverted when that PR is merged. --- README-iso.md | 2 +- .../8.2/etc/systemd/system/sshd.service.d/installer.conf | 5 +++++ .../etc/systemd/system/sshd.service.d/sshd_installer.conf | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 installimg/8.2/etc/systemd/system/sshd.service.d/installer.conf create mode 100644 installimg/8.3/etc/systemd/system/sshd.service.d/sshd_installer.conf diff --git a/README-iso.md b/README-iso.md index d3e8931..56f855e 100644 --- a/README-iso.md +++ b/README-iso.md @@ -102,7 +102,7 @@ Work to reproduce install.img * missing files: - [x] /opt/xensource/installer/version.py - [x] installer.service getty@tty2.service - - [ ] sshd.service.d/installer.conf (disables sshd by default, enables with sshpassword=xxxx) + - [x] sshd.service.d/installer.conf (disables sshd by default, enables with sshpassword=xxxx) - [ ] ldconfig.service xenstored.service etc. links to /dev/null (those two at least seem unneeded) - [ ] /etc/udev/rules.d/: 11-dm-mpath.rules 62-multipath.rules 69-dm-lvm-metad.rules links to /dev/null diff --git a/installimg/8.2/etc/systemd/system/sshd.service.d/installer.conf b/installimg/8.2/etc/systemd/system/sshd.service.d/installer.conf new file mode 100644 index 0000000..a68ce22 --- /dev/null +++ b/installimg/8.2/etc/systemd/system/sshd.service.d/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' diff --git a/installimg/8.3/etc/systemd/system/sshd.service.d/sshd_installer.conf b/installimg/8.3/etc/systemd/system/sshd.service.d/sshd_installer.conf new file mode 100644 index 0000000..a68ce22 --- /dev/null +++ b/installimg/8.3/etc/systemd/system/sshd.service.d/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'