Raspbian SSH Server fails after upgrade from Stretch to Buster (no SSH connection)
I used this excellent guide to update my Raspbian from Stretch to Buster:
After rebooting my Pi, the SSH connection was gone.
Logging into the Pi using the attached keyboard and monitor allowed me to debug the issue:
service ssh status
journalctl -u ssh -n 200
“Missing privilege separation directory /run/sshd”
This directory needs to be created at startup for the ssh daemon to start properly.
You can ensure that this directory gets created by creating a special file:
sudo nano /usr/lib/tmpfiles.d/sshd.conf
add the following content to this file:
# Fixup for ssh missing directory
d /run/sshd 0755 root root
Save (Ctrl + O) and Exit (Ctrl + X)
Ensure the user rights are correctly set:
ls -alh /usr/lib/tmpfiles.d/sshd.conf
Reboot your Pi:
sudo reboot
SSH should now hopefully come up again.
Ref:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864190 – this bugreport shows how to create temporary files as a Debian packager, and the installation directory they are installed into.