mirror of https://github.com/alibaba/arthas.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
7.4 KiB
JavaScript
14 lines
7.4 KiB
JavaScript
import{_ as t,o as i,c as o,a as e,b as d,d as a,e as n,r}from"./app.5024572d.js";const c={},l=a(`<h1 id="auth" tabindex="-1"><a class="header-anchor" href="#auth" aria-hidden="true">#</a> auth</h1><div class="custom-container tip"><p class="custom-container-title">\u63D0\u793A</p><p>\u9A8C\u8BC1\u5F53\u524D\u4F1A\u8BDD</p></div><h2 id="\u914D\u7F6E\u7528\u6237\u540D\u548C\u5BC6\u7801" tabindex="-1"><a class="header-anchor" href="#\u914D\u7F6E\u7528\u6237\u540D\u548C\u5BC6\u7801" aria-hidden="true">#</a> \u914D\u7F6E\u7528\u6237\u540D\u548C\u5BC6\u7801</h2><p>\u5728 attach \u65F6\uFF0C\u53EF\u4EE5\u5728\u547D\u4EE4\u884C\u6307\u5B9A\u5BC6\u7801\u3002\u6BD4\u5982\uFF1A</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>java -jar arthas-boot.jar --password ppp
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><ul><li><p>\u53EF\u4EE5\u901A\u8FC7 <code>--username</code> \u9009\u9879\u6765\u6307\u5B9A\u7528\u6237\uFF0C\u9ED8\u8BA4\u503C\u662F<code>arthas</code>\u3002</p></li><li><p>\u4E5F\u53EF\u4EE5\u5728 <code>arthas.properties</code> \u91CC\u4E2D\u914D\u7F6E username/password\u3002\u547D\u4EE4\u884C\u7684\u4F18\u5148\u7EA7\u5927\u4E8E\u914D\u7F6E\u6587\u4EF6\u3002</p></li><li><p>\u5982\u679C\u53EA\u914D\u7F6E<code>username</code>\uFF0C\u6CA1\u6709\u914D\u7F6E<code>password</code>\uFF0C\u5219\u4F1A\u751F\u6210\u968F\u673A\u5BC6\u7801\uFF0C\u6253\u5370\u5728<code>~/logs/arthas/arthas.log</code>\u4E2D</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>Using generated security password: 0vUBJpRIppkKuZ7dYzYqOKtranj4unGh
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></li></ul><h2 id="\u672C\u5730\u8FDE\u63A5\u4E0D\u9274\u6743" tabindex="-1"><a class="header-anchor" href="#\u672C\u5730\u8FDE\u63A5\u4E0D\u9274\u6743" aria-hidden="true">#</a> \u672C\u5730\u8FDE\u63A5\u4E0D\u9274\u6743</h2><p>\u9ED8\u8BA4\u60C5\u51B5\u4E0B\uFF0C\u5728<code>arthas.properties</code>\u6587\u4EF6\u91CC\u6709\u914D\u7F6E\uFF1A</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>arthas.localConnectionNonAuth=true
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>\u5F53\u914D\u7F6E\u5BC6\u7801\u65F6\uFF0C\u4F7F\u7528\u672C\u5730\u8FDE\u63A5\uFF0C\u4E5F\u4E0D\u9700\u8981\u9274\u6743\u3002\u9ED8\u8BA4\u914D\u7F6E\u503C\u662F true\uFF0C\u65B9\u4FBF\u672C\u5730\u8FDE\u63A5\u4F7F\u7528\u3002\u53EA\u6709\u8FDC\u7A0B\u8FDE\u63A5\u65F6\uFF0C\u624D\u9700\u8981\u9274\u6743\u3002</p><h2 id="\u5728-telnet-console-\u91CC\u9274\u6743" tabindex="-1"><a class="header-anchor" href="#\u5728-telnet-console-\u91CC\u9274\u6743" aria-hidden="true">#</a> \u5728 telnet console \u91CC\u9274\u6743</h2><p>\u8FDE\u63A5\u5230 arthas \u540E\uFF0C\u76F4\u63A5\u6267\u884C\u547D\u4EE4\u4F1A\u63D0\u793A\u9700\u8981\u9274\u6743\uFF1A</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token punctuation">[</span>arthas@37430<span class="token punctuation">]</span>$ <span class="token builtin class-name">help</span>
|
|
Error<span class="token operator">!</span> <span class="token builtin class-name">command</span> not permitted, try to use <span class="token string">'auth'</span> <span class="token builtin class-name">command</span> to authenticates.
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>\u4F7F\u7528<code>auth</code>\u547D\u4EE4\u6765\u9274\u6743\uFF0C\u6210\u529F\u4E4B\u540E\u53EF\u4EE5\u6267\u884C\u5176\u5B83\u547D\u4EE4\u3002</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>[arthas@37430]$ auth ppp
|
|
Authentication result: true
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ul><li>\u53EF\u4EE5\u901A\u8FC7 <code>--username</code> \u9009\u9879\u6765\u6307\u5B9A\u7528\u6237\uFF0C\u9ED8\u8BA4\u503C\u662F<code>arthas</code>\u3002</li></ul><h2 id="web-console-\u5BC6\u7801\u9A8C\u8BC1" tabindex="-1"><a class="header-anchor" href="#web-console-\u5BC6\u7801\u9A8C\u8BC1" aria-hidden="true">#</a> Web console \u5BC6\u7801\u9A8C\u8BC1</h2><p>\u6253\u5F00\u6D4F\u89C8\u5668\uFF0C\u4F1A\u6709\u5F39\u7A97\u63D0\u793A\u9700\u8981\u8F93\u5165 \u7528\u6237\u540D \u548C \u5BC6\u7801\u3002</p><p>\u6210\u529F\u4E4B\u540E\uFF0C\u5219\u53EF\u4EE5\u76F4\u63A5\u8FDE\u63A5\u4E0A web console\u3002</p><h2 id="http-api-\u9A8C\u8BC1" tabindex="-1"><a class="header-anchor" href="#http-api-\u9A8C\u8BC1" aria-hidden="true">#</a> HTTP API \u9A8C\u8BC1</h2><h3 id="authorization-header-\u65B9\u5F0F-\u63A8\u8350" tabindex="-1"><a class="header-anchor" href="#authorization-header-\u65B9\u5F0F-\u63A8\u8350" aria-hidden="true">#</a> Authorization Header \u65B9\u5F0F\uFF08\u63A8\u8350\uFF09</h3><p>Arthas \u91C7\u7528\u7684\u662F HTTP \u6807\u51C6\u7684 Basic Authorization\uFF0C\u5BA2\u6237\u7AEF\u8BF7\u6C42\u65F6\u589E\u52A0\u5BF9\u5E94\u7684 header \u5373\u53EF\u3002</p>`,22),u=n("\u53C2\u8003\uFF1A"),p={href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication",target:"_blank",rel:"noopener noreferrer"},h=n("https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication"),m=a(`<p>\u4F8B\u5982\uFF0C\u7528\u6237\u540D\u662F\uFF1A<code>admin</code>\uFF0C\u5BC6\u7801\u662F <code>admin</code>\uFF0C\u5219\u7EC4\u5408\u4E3A\u5B57\u7B26\u4E32\uFF1A <code>admin:admin</code>\uFF0Cbase64 \u7ED3\u679C\u662F\uFF1A <code>YWRtaW46YWRtaW4=</code>\uFF0C\u5219 HTTP \u8BF7\u6C42\u589E\u52A0<code>Authorization</code> header\uFF1A</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">curl</span> <span class="token string">'http://localhost:8563/api'</span> <span class="token punctuation">\\</span>
|
|
<span class="token parameter variable">-H</span> <span class="token string">'Authorization: Basic YWRtaW46YWRtaW4='</span> <span class="token punctuation">\\</span>
|
|
--data-raw <span class="token string">'{"action":"exec","command":"version"}'</span>
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="url-\u53C2\u6570\u4F20\u9012\u65B9\u5F0F" tabindex="-1"><a class="header-anchor" href="#url-\u53C2\u6570\u4F20\u9012\u65B9\u5F0F" aria-hidden="true">#</a> URL \u53C2\u6570\u4F20\u9012\u65B9\u5F0F</h3><p>\u4E3A\u4E86\u65B9\u4FBF\u5404\u79CD\u7279\u6B8A\u60C5\u51B5\uFF0C\u652F\u6301\u4E86\u4EE5 parameters \u65B9\u5F0F\u4F20\u9012 username \u548C password\u3002\u6BD4\u5982\uFF1A</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code><span class="token function">curl</span> <span class="token string">'http://localhost:8563/api?password=admin'</span> <span class="token punctuation">\\</span>
|
|
--data-raw <span class="token string">'{"action":"exec","command":"version"}'</span>
|
|
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div>`,5);function v(b,g){const s=r("ExternalLinkIcon");return i(),o("div",null,[l,e("ul",null,[e("li",null,[u,e("a",p,[h,d(s)])])]),m])}const _=t(c,[["render",v],["__file","auth.html.vue"]]);export{_ as default};
|