mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
openssh: fix sshd key generation when systemd is in use and rootfs is readonly
[YOCTO #8365] (From OE-Core rev: d5ea131fe94939daabee1afe8219683de259b7a3) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
006497e36a
commit
299806d0dc
@@ -4,7 +4,9 @@ Wants=sshdgenkeys.service
|
|||||||
After=sshdgenkeys.service
|
After=sshdgenkeys.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=-@SBINDIR@/sshd -i
|
Environment="SSHD_OPTS="
|
||||||
|
EnvironmentFile=-/etc/default/ssh
|
||||||
|
ExecStart=-@SBINDIR@/sshd -i $SSHD_OPTS
|
||||||
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
|
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
|
||||||
StandardInput=socket
|
StandardInput=socket
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=OpenSSH Key Generation
|
Description=OpenSSH Key Generation
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
|
RequiresMountsFor=/var /run
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
|
ConditionPathExists=!/var/run/ssh/ssh_host_rsa_key
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
|
ConditionPathExists=!/var/run/ssh/ssh_host_dsa_key
|
||||||
ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key
|
ConditionPathExists=!/var/run/ssh/ssh_host_ecdsa_key
|
||||||
|
ConditionPathExists=!/var/run/ssh/ssh_host_ed25519_key
|
||||||
|
ConditionPathExists=!/etc/ssh/ssh_host_rsa_key
|
||||||
|
ConditionPathExists=!/etc/ssh/ssh_host_dsa_key
|
||||||
|
ConditionPathExists=!/etc/ssh/ssh_host_ecdsa_key
|
||||||
|
ConditionPathExists=!/etc/ssh/ssh_host_ed25519_key
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@BINDIR@/ssh-keygen -A
|
Environment="SYSCONFDIR=/etc/ssh"
|
||||||
|
EnvironmentFile=-/etc/default/ssh
|
||||||
|
ExecStart=@BASE_BINDIR@/mkdir -p $SYSCONFDIR
|
||||||
|
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' -t rsa
|
||||||
|
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' -t dsa
|
||||||
|
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' -t ecdsa
|
||||||
|
ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ed25519_key -N '' -t ed25519
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|||||||
Reference in New Issue
Block a user