I created a user that run timers and service with systemctl --user
. When I try to login via ssh
, I have no issue with systemctl --user
. But when I connect to this user with su
, I have a bus error:
me@some_host / $ sudo su -l some_user -
some_user@some_host / $ systemctl --user status a_random.service
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)
Then I tried this:
me@some_host / $ systemctl --machine=some_user@.host --user status a_random.service
Cannot access user instance remotely.
I am running this on Debian. I think it as to do with pam.d
but not sure. Any idea on how to solve this?