After installing bitcoin on CentOS/AWS, an error occurs when connecting with cli.

$ bitcoind -daemon -conf=/.bitcoin/bitcoin.conf
Bitcoin server starting
$ bitcoin-cli getbalance
error: Authorization failed: Incorrect rpcuser or rpcpassword

The following is bitcoin.conf.

mainnet = 1
txindex = 1
server = 1
rest = 1
rpcuser = a
rpcpassword = a
rpcport = 8332
  • The following is displayed when executing bitcoind. ---------- Binding RPC on address ::1 port 8332 failed. ---------- Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcauth for rpcauth auth generation. ---------- – kotora Mar 29 '19 at 11:00
  • -conf=/.bitcoin/bitcoin.conf is unusual as it suggests you're keeping the .bitcoin outside your /home folder. If that's a mistake, it would explain why bitcoin-cli can't find the credentials - the conf file you're specifying doesn't exist. Are you sure you sure you don't mean -conf=/home/<user>/.bitcoin/bitcoin.conf? – Alistair Mann Mar 29 '19 at 16:21
  • Thank you for answering.I created bitcoin.conf with the following command. Is that wrong? mkdir ~/.bitcoin vi ~/.bitcoin/bitcoin.conf – kotora Apr 1 '19 at 12:43
  • If that's two commands then they do seem right. However your question says you used /.bitcoin/bitcoin.conf which is not the same as ~/.bitcoin/bitcoin.conf. The first says start in the root of your file system, the second - with a tilde '~' - says to start in your home folder. – Alistair Mann Apr 9 '19 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.