0

I am working on an Embedded Linux platform with SystemD Version 241 and a Linux Kernel Version 4.19.78.

I want to use D-Feet to remotely inspect various DBus interfaces.

I've done this in the past with an older version of SystemD using these instructions.

I've created a new DBus configuration file /usr/share/dbus-1/system.d/d-feet.conf:

<listen>tcp:host=localhost,bind=*,port=55556,family=ipv4</listen>
<listen>unix:tmpdir=/tmp</listen>

<busconfig>
  <auth>ANONYMOUS</auth>
  <allow_anonymous/>
</busconfig>

When I run netstat -plntu | grep 55556, I can see the port is bound:

tcp6       0      0 :::55556                :::*                    LISTEN      1/init

I have also edited the /lib/systemd/system/dbus.socket file:

[Unit]
Description=D-Bus System Message Bus Socket

[Socket]
ListenStream=/var/run/dbus/system_bus_socket
ListenStream=55556

However, when I try to connect from an Ubuntu 18.04 Linux machine on the same network, I see that it fails and is not offered the "ANONYMOUS" authentication method I have defined:

can not connect to 'tcp:host=192.168.1.16,port=55556': g-io-error-quark: Exhausted all available authentication mechanisms (tried: EXTERNAL) (available: EXTERNAL) (0)

How can I get this to work? Thank you.

UPDATE: I tried with '0.0.0.0' as the bind address:

<listen>tcp:host=localhost,bind=0.0.0.0,port=55556,family=ipv4</listen>
<listen>unix:tmpdir=/tmp</listen>

<busconfig>
  <auth>ANONYMOUS</auth>
  <allow_anonymous/>
</busconfig>

However, it still fails with the same error and the output of systemctl show dbus.socket includes the following:

PassCredentials=no
PassSecurity=no
RemoveOnStop=no
Listen=/var/run/dbus/system_bus_socket (Stream)
Listen=[::]:55556 (Stream)
Mark=-1
MaxConnections=64
MaxConnectionsPerSource=0
MessageQueueMaxMessages=0
0andriy
  • 4,183
  • 1
  • 24
  • 37
PhilBot
  • 748
  • 18
  • 85
  • 173
  • Please change the configuration to `bind=0.0.0.0`, Then run `systemctl daemon-reload` and `systemctl restart dbus.socket`. And then update the question with output of `systemctl show dbus.socket` – binarysta Apr 26 '20 at 16:04
  • Hi - thanks for the comment. I tried what you suggested, unfortunately it still fails - but I pasted more details in the question. – PhilBot Apr 26 '20 at 21:21
  • Which command do you use to connect to DBus? – ximaera Apr 27 '20 at 12:18
  • I run D-Feet on a seperate Ubuntu 18 machine and use tcp:host=192.168.1.16,port=55556 – PhilBot Apr 27 '20 at 22:28

1 Answers1

1

I just stumbled across something that works. If I edit the /usr/share/dbus-1/system.conf file, and add the following:

<busconfig>
   <listen>tcp:host=localhost,bind=0.0.0.0,port=55556,family=ipv4</listen>
   <listen>unix:tmpdir=/tmp</listen>

   <auth>ANONYMOUS</auth>
   <allow_anonymous/>
</busconfig>

It seems to work, if I do not do that, and rely on my changes in the d-feet.conf file, then it seems to fail.

Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
PhilBot
  • 748
  • 18
  • 85
  • 173