I've been wondering how an MQTT client could instruct the broker to disconnect a client by some means, in case I need to force-disconnect a client from my MQTT server (for example, if it's misbehaving somehow and not responding correctly).

A previous question highlighted the possibility of just connecting with the same client ID as the client you want to kill, but this seems unreliable at best and I'm wondering if there's a more reliable option that will meet my needs:

  • allows an authorised client to disconnect any other client from the network by client ID
  • ideally, prevents unauthorised clients from disconnecting others (so that only the 'trusted' client can disconnect others)

Is there a feature that meets such requirements?

1 Answer 1


Not directly.

You could use an authentication plugin such as mosquitto-auth-plug to dynamically add users to a banned list and then force a disconnection by connecting with a duplicate client id.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.