The “accepted reply” is technically appropriate nevertheless it’s INCORRECT in its reasoning and does not clarify that there are literally 2 RPC auth strategies for bitcoind (which bitcoin-cli communicates with).
The commandline -rpcuser and -rpcpassword are NOT FOR rpcauth accounts. That is the primary drawback that was by no means talked about within the accepted reply.
It additionally failed to say that you simply can not use rpcauth creds from the bitcoin-cli command line app. Bitcoind has 2 RPC auth strategies, just one of them is accessible through command line and that is the outdated one which’s going to be eliminated. After that, you are screwed. No extra command line entry to bitcoind through bitcoin-cli (like that makes any sense …). You will need to create your individual script and connect with it over the RPC port with out using bitcoin-cli from what I can inform.
For now it’s a must to use rpcuser and rpcpass both on the command line or in bitcoin.conf file. Maybe rpcauth assist can be added to the command line sooner or later for however for the time being, it does not seem like that is going to occur.
Anyway if anybody can truly present an actual reply to this (that makes use of rpcauth from the bitcoin-cli command line app), be happy. I see no method to make use of rpcauth from command line bitcoin-cli for the time being. It seems like https://github.com/bitcoin/bitcoin/blob/grasp/share/rpcauth/rpcauth.py goes to exchange it however presently all it does is generate passwords. That is fairly ineffective so far as truly utilizing any pre-built command line apps for speaking with bitcoind is anxious.