Scenario: Debian installed with nothing selected in the tasksel
stage (not even the standard system utilities) – i.e. the most minimal install you can get with the standard installer. Once installed you then install the ssh
server
apt install ssh
This pulls in a bunch of dependencies, including dbus
. You then can ssh
into the system as normal. When trying to shutdown or reboot the system you get an error:
Failed to connect to bus: No such file or directory
This does not prevent the shutdown or reboot happening, although the ssh
connection is not closed cleanly and your have to press enter at the local terminal to get it to realize the connection is down.
This also appears to cause an error in the logs when connecting via ssh
pam_systemd(sshd:session): Failed to connect to system bus: No such file or directory
The solution as discussed at this StackOverflow post seems to be to reinstall dbus
:
apt install --reinstall dbus
This gets rid of the errors, and on shutdown of the system the ssh
connection is terminated normally.