# 設定mosquitto Server

設定檔位置:

cd /data/data/com.termux/files/usr/etc/mosquitto

mv mosquitto.conf mosquitto.confbak

設定密碼檔案

```bash
mosquitto_passwd -c pwfile admin
```

pm2 stop mosquitto

編輯設定檔 -> nano mosquitto.conf

```
password_file /data/data/com.termux/files/usr/etc/mosquitto/pwfile
allow_anonymous false

port 1883
```

pm2 start mosquitto


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/andoid-shou-ji/termux/she-ding-mosquitto-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
