分類彙整: Linux
如何在Ubuntu16.04上安裝Mosquitto這個MQTT消息服務器並對其進行安全配置
https://www.itread01.com/content/1513183233.html
https://blog.csdn.net/u013332124/article/details/79480639
接下來,為Mosquitto打開一個新的配置文件,指定所有連接登錄時所需的密碼文件。
sudo vi /etc/mosquitto/conf.d/default.conf
上述命令會打開一個新的配置文件。把下面的內容粘貼進去:
allow_anonymous false
password_file /etc/mosquitto/passwd
port 1883
新增使用者
mosquitto_passwd -b /etc/mosquitto/passwd user password
Ubuntu 20.04 在apache上安裝ssl憑證
sudo apt install python3-certbot-apache
sudo certbot --apache -d my.domain
定時更新憑證
sudo crontab -e
30 4 1,21 * * /usr/bin/certbot renew –dry-run
sudo certbot certonly –server https://acme-v02.api.letsencrypt.org/directory –manual –preferred-challenges dns -d ‘*.lifenet.com.tw’
sudo certbot certonly –server https://acme-v02.api.letsencrypt.org/directory –webroot –preferred-challenges dns -d ‘*.lifenet.com.tw’
(SSL)申請Let’s Encrypt-以Raspberry Pi為例
cd /usr/local/bin
wget https://dl.eff.org/certbot-auto
sudo ./certbot-auto –apache –domain=alltrue.dunhua.lifenet.com.tw
30 2 1 * * /usr/local/bin/certbot-auto renew –quiet