Products › lamco-dbus-tools › Docs

Use dbussee over ssh, and where there's no session bus

Use dbussee over ssh to reach a machine's D-Bus session and system buses, copy the static program to a machine without it, and see what a missing bus gives.

Describes version 0.4.1.

A session bus over ssh

On a machine where systemd runs a user manager, logging in over ssh gives the session the user's bus at /run/user/<uid>/bus, the same bus as that user's desktop. dbussee finds it as any program does: From DBUS_SESSION_BUS_ADDRESS, or the bus socket in XDG_RUNTIME_DIR.

ssh host dbussee check

Copy the static program

On a machine without lamco-dbus-tools, copy the static build, which needs nothing of the machine's libraries:

scp target/x86_64-unknown-linux-musl/release/dbussee host:/var/tmp/
ssh host /var/tmp/dbussee check --bus system

Building lamco-dbus-tools says how to build it, for x86_64 and 64-bit ARM. The 64-bit ARM programs have run only under emulation.

Where there's no session bus

A root shell from sudo, a cron job, a container, or a login with no user manager has no session bus. dbussee says so and doesn't guess:

$ dbussee check
Bus (session): Not examined.
    no connection to the session bus: failed to connect to `unix:path=/run/user/1000/bus`: No such file or directory (os error 2)
Findings: 0 problems, 1 notices

BUS-001 (notice): No bus answered

check and observe exit 0 here, since reporting there's no bus is their job. bus and names exit 1, since they had nothing to show.

To reach a particular user's bus from another shell of that user, name it:

dbussee check --address unix:path=/run/user/1000/bus

The system bus is there for every user:

dbussee check --bus system