title: Authentication failed (rejected by the remote node), please check the Erlang cookie
body: <p>I installed erlang and rabbitmq in the way mentioned in the official documentation. But then, when I do this </p>
  
  <p><strong>C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.0\sbin>rabbitmqctl add_user XXXXXX YYYYYYY</strong></p>
  
  <p>it gives me the following error...</p>
  
  <hr>
  
  <p>Error: unable to perform an operation on node 'rabbit@C001741998'. Please see diagnostics information and suggestions below.</p>
  
  <p>Most common reasons for this are:</p>
  
  <ul>
  <li>Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)</li>
  <li>CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)</li>
  <li>Target node is not running</li>
  </ul>
  
  <p>In addition to the diagnostics info below:</p>
  
  <ul>
  <li>See the CLI, clustering and networking guides on <a href="http://rabbitmq.com/documentation.html" rel="noreferrer">http://rabbitmq.com/documentation.html</a> to learn more</li>
  <li>Consult server logs on node rabbit@C001741998</li>
  </ul>
  
  <h1>DIAGNOSTICS</h1>
  
  <p>attempted to contact: [rabbit@C001741998]</p>
  
  <p>rabbit@C001741998:</p>
  
  <ul>
  <li><p>connected to epmd (port 4369) on C001741998</p></li>
  <li><p>epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic</p></li>
  <li><p>TCP connection succeeded but Erlang distribution failed</p></li>
  <li><p>Authentication failed (rejected by the remote node), please check the Erlang cookie</p></li>
  </ul>
  
  <p>Current node details:</p>
  
  <ul>
  <li><p>node name: rabbitmqcli49@C001741998</p></li>
  <li><p>effective user's home directory: C:\Users\XYZ</p></li>
  <li><p>Erlang cookie hash: QJlwBuAgrn8gN00mjqQYOw==</p></li>
  </ul>
  
  <hr>
  
  <p>I copied the erlang cookie from my user home folder to C:\Windows folder. So, they both have the same cookie. Still it keeps throwing me the error. Not sure how it should be fixed. Any help??</p>
  
  <h1>UPDATE</h1>
  
  <p>I figured out that the best way to run rabbitmq is from docker container. In that way, you do not need to bother about any cookie or dependencies, also you get rabbitmq up and running in few minutes. Hope it helps someone!</p>