The “accepted answer” is technically correct but it’s INCORRECT in its reasoning and doesn’t explain that there are actually 2 RPC auth methods for bitcoind (which bitcoin-cli communicates with).
The commandline -rpcuser and -rpcpassword are NOT FOR rpcauth accounts. That’s the first problem that was never mentioned in the accepted answer.
It also failed to mention that you cannot use rpcauth creds from the bitcoin-cli command line app. Bitcoind has 2 RPC auth methods, only 1 of them is available via command line and that’s the old one that’s going to be removed. After that, you’re screwed. No more command line access to bitcoind via bitcoin-cli (like that makes any sense …). You’ll have to create your own script and connect to it over the RPC port without the use of bitcoin-cli from what I can tell.
For now you have to use rpcuser and rpcpass either on the command line or in bitcoin.conf file. Perhaps rpcauth support will be added to the command line in the future for but at the moment, it doesn’t appear like that’s going to happen.
Anyway if anyone can actually show a real answer to this (that uses rpcauth from the bitcoin-cli command line app), feel free. I see no way to use rpcauth from command line bitcoin-cli at the moment. It looks like https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py is going to replace it but currently all it does is generate passwords. That’s pretty useless as far as actually using any pre-built command line apps for communicating with bitcoind is concerned.











