From a2a7ddc95f640335136c8460661ffcb3aba64beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Molinero=20Fern=C3=A1ndez?= Date: Sun, 16 Jan 2022 01:34:25 +0100 Subject: [PATCH] Create "/run/sshd/" directory in the init script --- scripts/bin/container-init | 5 +++++ scripts/service/sshd/run | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/bin/container-init b/scripts/bin/container-init index c7d86d0..c192c88 100755 --- a/scripts/bin/container-init +++ b/scripts/bin/container-init @@ -76,6 +76,11 @@ if [ -z "${VGL_DISPLAY-}" ]; then fi fi +# Create privilege separation directory for SSH server if it does not exist +if [ ! -e /run/sshd/ ]; then + mkdir /run/sshd/ +fi + # Generate SSH keys if they do not exist if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' >/dev/null diff --git a/scripts/service/sshd/run b/scripts/service/sshd/run index 883dc3a..83cf4c3 100755 --- a/scripts/service/sshd/run +++ b/scripts/service/sshd/run @@ -1,8 +1,4 @@ #!/bin/sh -if [ ! -e /run/sshd/ ]; then - mkdir /run/sshd/ -fi - exec 2>&1 exec /usr/sbin/sshd -D