openssh: allow to override OpenSSL HostKeys when read-only-rootfs
PATCH 1/1 openssh: allow to override OpenSSL HostKeys when read-only-rootfs
From: André Draszik <[email protected]>
With these changes it is possible to have a .bbappend that
- sets SYSCONFDIR to some persistent storage
- modifies SYSCONFDIR/sshd_config to use ssh host keys from the (writable) sysconfdir
Signed-off-by André Draszik <[email protected]>
Reviewed-by Stephane Ayotte <[email protected]>
--- meta/classes/rootfs-postcommands.bbclass | 4 +-- meta/recipes-connectivity/openssh/openssh/init | 46 +++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 6 deletions(-)
meta/classes/rootfs-postcommands.bbclass +2 -2
@@ -93,10 +93,10 @@ read_only_rootfs_hook () { # and the keys under /var/run/ssh. if [ -d ${IMAGE_ROOTFS}/etc/ssh ]; then if [ -e ${IMAGE_ROOTFS}/etc/ssh/ssh_host_rsa_key ]; then - echo "SYSCONFDIR=/etc/ssh" >> ${IMAGE_ROOTFS}/etc/default/ssh + echo "SYSCONFDIR=\${SYSCONFDIR:-/etc/ssh}" >> ${IMAGE_ROOTFS}/etc/default/ssh echo "SSHD_OPTS=" >> ${IMAGE_ROOTFS}/etc/default/ssh else - echo "SYSCONFDIR=/var/run/ssh" >> ${IMAGE_ROOTFS}/etc/default/ssh + echo "SYSCONFDIR=\${SYSCONFDIR:-/var/run/ssh}" >> ${IMAGE_ROOTFS}/etc/default/ssh echo "SSHD_OPTS='-f /etc/ssh/sshd_config_readonly'" >> ${IMAGE_ROOTFS}/etc/default/ssh fi fi
meta/recipes-connectivity/openssh/openssh/init +42 -4
73 lines not on this page · raw message
Signature · 1 line
2.11.0