<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.jackslab.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-cn">
		<id>http://wiki.jackslab.org/index.php?action=history&amp;feed=atom&amp;title=EMQTT</id>
		<title>EMQTT - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.jackslab.org/index.php?action=history&amp;feed=atom&amp;title=EMQTT"/>
		<link rel="alternate" type="text/html" href="http://wiki.jackslab.org/index.php?title=EMQTT&amp;action=history"/>
		<updated>2026-09-11T05:14:56Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.19.2</generator>

	<entry>
		<id>http://wiki.jackslab.org/index.php?title=EMQTT&amp;diff=13600&amp;oldid=prev</id>
		<title>2020年3月27日 (五) 22:44 Comcat</title>
		<link rel="alternate" type="text/html" href="http://wiki.jackslab.org/index.php?title=EMQTT&amp;diff=13600&amp;oldid=prev"/>
				<updated>2020-03-27T22:44:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←上一版本&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;2020年3月27日 (五) 22:44的版本&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第91行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第91行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=bash&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;source lang=bash&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* https://docs.emqx.io/broker/latest/cn/advanced/acl.html&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;== Reference ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* https://docs.emqx.io/broker/v3/cn/plugins.html#http-api-cli&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* https://docs.emqx.io/broker/latest/cn/advanced/acl.html&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;* https://www.bbsmax.com/A/8Bz8bGDk5x/&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Comcat</name></author>	</entry>

	<entry>
		<id>http://wiki.jackslab.org/index.php?title=EMQTT&amp;diff=13599&amp;oldid=prev</id>
		<title>Comcat：以“== 开启认证 ==  === 关闭匿名认证 ===  默认开启，需要手动关闭匿名认证  1. 进入安装目录下 /etc，打开 emqx.conf文件    cd /opt/emqt...”为内容创建页面</title>
		<link rel="alternate" type="text/html" href="http://wiki.jackslab.org/index.php?title=EMQTT&amp;diff=13599&amp;oldid=prev"/>
				<updated>2020-03-27T22:36:51Z</updated>
		
		<summary type="html">&lt;p&gt;以“== 开启认证 ==  === 关闭匿名认证 ===  默认开启，需要手动关闭匿名认证  1. 进入安装目录下 /etc，打开 emqx.conf文件    cd /opt/emqt...”为内容创建页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 开启认证 ==&lt;br /&gt;
&lt;br /&gt;
=== 关闭匿名认证 ===&lt;br /&gt;
&lt;br /&gt;
默认开启，需要手动关闭匿名认证&lt;br /&gt;
&lt;br /&gt;
1. 进入安装目录下 /etc，打开 emqx.conf文件&lt;br /&gt;
&lt;br /&gt;
  cd /opt/emqtt/etc&lt;br /&gt;
  vim emqx.conf&lt;br /&gt;
&lt;br /&gt;
2. 找到这一行: allow_anonymous = true &lt;br /&gt;
&lt;br /&gt;
将 true 改为 false，保存、退出，就关闭了匿名认证&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 添加 Username 插件 emq_auth_username ===&lt;br /&gt;
&lt;br /&gt;
1. bin 目录下执行下面命令，加载 emq_auth_username 插件&lt;br /&gt;
&lt;br /&gt;
   ./emqttd_ctl plugins load emq_auth_username&lt;br /&gt;
&lt;br /&gt;
2. 执行下面命令,添加一个用户名和密码&lt;br /&gt;
&lt;br /&gt;
  ./emqttd_ctl users add test 123456&lt;br /&gt;
&lt;br /&gt;
3 使用下面命令可以执行所需的操作,大功告成&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
./emqx_ctl users&lt;br /&gt;
users list                                      # List users&lt;br /&gt;
users add &amp;lt;Username&amp;gt; &amp;lt;Password&amp;gt;                 # Add User&lt;br /&gt;
users update &amp;lt;Username&amp;gt; &amp;lt;NewPassword&amp;gt;           # Update User&lt;br /&gt;
users del &amp;lt;Username&amp;gt;                            # Delete User&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ACL ==&lt;br /&gt;
&lt;br /&gt;
支持基于 etc/acl.conf 或 MySQL，PostgreSQL 等插件的访问控制&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
## ACL nomatch. Enum: allow, deny&lt;br /&gt;
acl_nomatch = allow&lt;br /&gt;
&lt;br /&gt;
## Default ACL File&lt;br /&gt;
acl_file = etc/acl.conf&lt;br /&gt;
&lt;br /&gt;
## Enable ACL cache. Enum: on, off&lt;br /&gt;
enable_acl_cache = on&lt;br /&gt;
&lt;br /&gt;
## Default ACL cache size&lt;br /&gt;
acl_cache_max_size = 32&lt;br /&gt;
&lt;br /&gt;
## Default time-to-live of&lt;br /&gt;
cache size acl_cache_ttl = 1m&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
上面标黄得那个我们配置的关键，当acl规则没有匹配到的时候就会找的这个参数，如果为true，则会通过验证，为false就会不通过验证&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
官方说明：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
%% 允许'dashboard'用户订阅 '$SYS/#'&lt;br /&gt;
{allow, {user, &amp;quot;dashboard&amp;quot;}, subscribe, [&amp;quot;$SYS/#&amp;quot;]}.&lt;br /&gt;
&lt;br /&gt;
%% 允许本机用户发布订阅全部主题&lt;br /&gt;
{allow, {ipaddr, &amp;quot;127.0.0.1&amp;quot;}, pubsub, [&amp;quot;$SYS/#&amp;quot;, &amp;quot;#&amp;quot;]}.&lt;br /&gt;
&lt;br /&gt;
%% 拒绝用户订阅'$SYS#'与'#'主题&lt;br /&gt;
{deny, all, subscribe, [&amp;quot;$SYS/#&amp;quot;, {eq, &amp;quot;#&amp;quot;}]}.&lt;br /&gt;
&lt;br /&gt;
%% 上述规则无匹配，允许&lt;br /&gt;
{allow, all}.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
'''注意：'''&lt;br /&gt;
&lt;br /&gt;
* 注释使用 %%&lt;br /&gt;
*不要忘了每个规则后面的 '.' &lt;br /&gt;
* subscribe 和 pubsub 配合使用&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''参考配置：'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Comcat</name></author>	</entry>

	</feed>