Bug SSH 2026-03-14

๐Ÿ‘ป The Server tmpfs Trap: /run/sshd Vanishes on Reboot, SSH Connection Refused

tmpfs Reboot Disappearance Chain Server reboot โ†’ run is a tmpfs (memory filesystem) โ€” cleared on every reboot. sshd needs /run/sshd for its PID file; without it, sshd refuses to start. Some distros have RuntimeDirectory=sshd in their systemd unit to auto-create it, but minimal or container systems may have that line removed.

โœ… Fix: Created /etc/tmpfiles.d/sshd.conf with one line: d /run/sshd 0755 root root -. Now systemd-tmpfiles auto-creates the directory on every boot โ€” permanent fix.

How to Avoid:

1. Never assume directories under /run persist โ€” it is tmpfs, cleared on reboot

2. Fix: echo 'd /run/sshd 0755 root root -' > /etc/tmpfiles.d/sshd.conf

3. Always keep a backup login method (VNC/web panel) โ€” if SSH dies, you still have a way in

4. After fixing, do a real reboot test โ€” do not wait for the next accidental reboot to find out it did not work