summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2015-09-30 15:53:16 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-01 07:43:37 +0100
commit299806d0dcb77271cb004b032cbfd83aa6fc4a00 (patch)
tree72dce965887972aa3f63133a69cec6ec7154c904
parent006497e36a78dd184457330a3d9c67f9dad6e3bb (diff)
downloadpoky-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@.service4
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service21
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
4After=sshdgenkeys.service 4After=sshdgenkeys.service
5 5
6[Service] 6[Service]
7ExecStart=-@SBINDIR@/sshd -i 7Environment="SSHD_OPTS="
8EnvironmentFile=-/etc/default/ssh
9ExecStart=-@SBINDIR@/sshd -i $SSHD_OPTS
8ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID 10ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
9StandardInput=socket 11StandardInput=socket
10StandardError=syslog 12StandardError=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]
2Description=OpenSSH Key Generation 2Description=OpenSSH Key Generation
3ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key 3RequiresMountsFor=/var /run
4ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key 4ConditionPathExists=!/var/run/ssh/ssh_host_rsa_key
5ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key 5ConditionPathExists=!/var/run/ssh/ssh_host_dsa_key
6ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key 6ConditionPathExists=!/var/run/ssh/ssh_host_ecdsa_key
7ConditionPathExists=!/var/run/ssh/ssh_host_ed25519_key
8ConditionPathExists=!/etc/ssh/ssh_host_rsa_key
9ConditionPathExists=!/etc/ssh/ssh_host_dsa_key
10ConditionPathExists=!/etc/ssh/ssh_host_ecdsa_key
11ConditionPathExists=!/etc/ssh/ssh_host_ed25519_key
7 12
8[Service] 13[Service]
9ExecStart=@BINDIR@/ssh-keygen -A 14Environment="SYSCONFDIR=/etc/ssh"
15EnvironmentFile=-/etc/default/ssh
16ExecStart=@BASE_BINDIR@/mkdir -p $SYSCONFDIR
17ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_rsa_key -N '' -t rsa
18ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_dsa_key -N '' -t dsa
19ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ecdsa_key -N '' -t ecdsa
20ExecStart=@BINDIR@/ssh-keygen -q -f ${SYSCONFDIR}/ssh_host_ed25519_key -N '' -t ed25519
10Type=oneshot 21Type=oneshot
11RemainAfterExit=yes 22RemainAfterExit=yes