sshd.service on Debian uses RuntimeDirectory=sshd, without which sshd
complains:
[ 4065.834904] sshd[711]: Missing privilege separation directory: /run/sshd
[ 4065.835785] systemd[1]: mysshserver@0-127.0.0.1:4711-127.0.0.1:58232.service: Deactivated successfully.
[ 4065.836433] testsuite-46.sh[708]: kex_exchange_identification: read: Connection reset by peer
[ 4065.836433] testsuite-46.sh[708]: Connection reset by 127.0.0.1 port 4711
Resolves: #31518
mkdir -p /etc/ssh
test -f /etc/ssh/ssh_host_ecdsa_key || ssh-keygen -t ecdsa -C '' -N '' -f /etc/ssh/ssh_host_ecdsa_key
- # ssh wants this dir around, but distros cannot agree on a common name for it, let's just create all that are aware of distros use
- mkdir -p /usr/share/empty.sshd /var/empty /var/empty/sshd
+ # ssh wants this dir around, but distros cannot agree on a common name for it, let's just create all that
+ # are aware of distros use
+ mkdir -p /usr/share/empty.sshd /var/empty /var/empty/sshd /run/sshd
mv /etc/pam.d/sshd /etc/pam.d/sshd.bak
cat >/etc/pam.d/sshd <<EOF