0

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
4
  • 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
    Commented Mar 29, 2019 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? Commented Mar 29, 2019 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
    Commented Apr 1, 2019 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. Commented Apr 9, 2019 at 10:41

1 Answer 1

-1

In case you changed your /etc/systemd/system/bitcoind.service make sure you run

 sudo systemctl stop bitcoind
 sudo systemctl daemon-reload
 sudo systemctl start bitcoind

to apply the changes.

1
  • While this advice may be useful, the question doesn't ask anything about systemd or with changing systemd service files.
    – Ava Chow
    Commented Nov 15, 2020 at 23:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.