Skip to contentSkip to conversation

openssh: Wait for local-fs before generating host keys

PATCH New [email protected] 1 participant 1 message Mar 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssh: Wait for local-fs before generating host keys

Currently, the sshdgenkeys.service wait for the host keys default paths /var and /run. The service runs a script which picks up the host key paths from the sshd_config which means that the paths are configurable and can potentially be placed outside /var and /run.

This patch makes sshdgenkeys.service wait for /etc/fstab to be mounted and which should include alternative host keys paths.

The requirement for /var and /run is left for backwards compatibility.

---
 meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service +2 -0
index fd81793d51..44831c9955 100644
@@ -1,6 +1,8 @@
 [Unit]
 Description=OpenSSH Key Generation
+Requires=local-fs.target
 RequiresMountsFor=/var /run
+After=local-fs.target
 
 [Service]
 ExecStart=@LIBEXECDIR@/sshd_check_keys
Signature · 1 line
2.31.0