diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2015-09-30 15:53:16 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-01 07:43:37 +0100 |
commit | 299806d0dcb77271cb004b032cbfd83aa6fc4a00 (patch) | |
tree | 72dce965887972aa3f63133a69cec6ec7154c904 | |
parent | 006497e36a78dd184457330a3d9c67f9dad6e3bb (diff) | |
download | poky-299806d0dcb77271cb004b032cbfd83aa6fc4a00.tar.gz |
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>
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh/sshd@.service | 4 | ||||
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service | 21 |
2 files changed, 19 insertions, 6 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd@.service b/meta/recipes-connectivity/openssh/openssh/sshd@.service index bb2d68e96a..9d83dfb2bb 100644 --- a/meta/recipes-connectivity/openssh/openssh/sshd@.service +++ b/meta/recipes-connectivity/openssh/openssh/sshd@.service | |||
@@ -4,7 +4,9 @@ Wants=sshdgenkeys.service | |||
4 | After=sshdgenkeys.service | 4 | After=sshdgenkeys.service |
5 | 5 | ||
6 | [Service] | 6 | [Service] |
7 | ExecStart=-@SBINDIR@/sshd -i | 7 | Environment="SSHD_OPTS=" |
8 | EnvironmentFile=-/etc/default/ssh | ||
9 | ExecStart=-@SBINDIR@/sshd -i $SSHD_OPTS | ||
8 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | 10 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID |
9 | StandardInput=socket | 11 | StandardInput=socket |
10 | StandardError=syslog | 12 | StandardError=syslog |
diff --git a/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service b/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service index d65086fc8a..148e6ad63a 100644 --- a/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service +++ b/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service | |||
@@ -1,11 +1,22 @@ | |||
1 | [Unit] | 1 | [Unit] |
2 | Description=OpenSSH Key Generation | 2 | Description=OpenSSH Key Generation |
3 | ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key | 3 | RequiresMountsFor=/var /run |
4 | ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key | 4 | ConditionPathExists=!/var/run/ssh/ssh_host_rsa_key |
5 | ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key | 5 | ConditionPathExists=!/var/run/ssh/ssh_host_dsa_key |
6 | ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key | 6 | ConditionPathExists=!/var/run/ssh/ssh_host_ecdsa_key |
7 | ConditionPathExists=!/var/run/ssh/ssh_host_ed25519_key | ||
8 | ConditionPathExists=!/etc/ssh/ssh_host_rsa_key | ||
9 | ConditionPathExists=!/etc/ssh/ssh_host_dsa_key | ||
10 | ConditionPathExists=!/etc/ssh/ssh_host_ecdsa_key | ||
11 | ConditionPathExists=!/etc/ssh/ssh_host_ed25519_key | ||
7 | 12 | ||
8 | [Service] | 13 | [Service] |
9 | ExecStart=@BINDIR@/ssh-keygen -A | 14 | Environment="SYSCONFDIR=/etc/ssh" |
15 | EnvironmentFile=-/etc/default/ssh | ||
16 | ExecStart=@BASE_BINDIR@/mkdir -p $SYSCONFDIR | ||
17 | ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' -t rsa | ||
18 | ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' -t dsa | ||
19 | ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' -t ecdsa | ||
20 | ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ed25519_key -N '' -t ed25519 | ||
10 | Type=oneshot | 21 | Type=oneshot |
11 | RemainAfterExit=yes | 22 | RemainAfterExit=yes |