Is there a way to add users programmatically?

236 views Asked by At

I see that mosquito_passwd could be used to create new users or remove users, but is there a way to manage users programmatically? That is, without calling an external shell command.

1

There are 1 answers

0
hardillb On BEST ANSWER

Mosquitto supports plugins for authentication and authorisation. There are several plugins available that support storing users/passwords in a database.

e.g. https://github.com/jpmens/mosquitto-auth-plug/

This plugin supports several different types of databases and includes a nodejs modules to generated the encrypted the passwords to insert into the database.