用 SHA2 方式 加密

Description

配置 graylog 所遇到設定密碼的問題

usage

<span class="hljs-keyword">echo</span> -n <span class="hljs-string">"Enter Password: "</span> &amp;&amp; head <span class="hljs-number">-1</span> &lt;/dev/stdin | tr -d ‘\n‘ | sha256sum | cut -d<span class="hljs-string">" "</span> -f1
Enter Password: <span class="hljs-number">123456</span>a  <span class="hljs-comment"># 輸入明文密碼</span>
f707fdda7c874ff49ebfb2c88a2860c5ff4ce3d94a21efb76566ad0f92c9ad57  <span class="hljs-comment"># SHA2加密後的密碼</span>