3

I run it like the below.

bitcoind -datadir=/Users/varunvb/Downloads -conf=/Users/varunvb/Downloads/bitcoin.conf -daemon

When I run (Using the user name and password as in the config file)

bitcoin-cli -rpcuser=<USER> -rpcpassword=<PWD> getinfo

I get error: incorrect rpcuser or rpcpassword (authorization failed)

I see the below in the debug log

ThreadRPCServer incorrect password attempt from 127.0.0.1

My bitcoin.conf file looks like this:

-e
rpcuser=<USER>
rpcpassword=<PWD>
  • What are the contents of bitcoin.conf? Is there another bitcoin-core instance running at the same time on the same machine? – George Kimionis Jan 12 '15 at 16:38
  • Thanks David for replying! The content inside config file is as below -e rpcuser=<USER> rpcpassword=<PWD> that's it. And no there're no other instances running apart from bitcoind i showed in the question – Ani Jan 12 '15 at 16:59
  • Remove that -e before rpcuser. Please consult this sample configuration. – George Kimionis Jan 12 '15 at 17:04
  • bitcoin-cli can read rpcuser and rpcpassword out of your config file. Just pass -conf=/Users/varunvb/Downloads/bitcoin.conf to bitcoin-cli. – Nick ODell Jan 12 '15 at 17:13
  • @NickODell has a point. Just call bitcoin-cli -conf=/Users/varunvb/Downloads/bitcoin.conf -datadir=/Users/varunvb/Downloads getinfo and that should be it. – George Kimionis Jan 12 '15 at 17:43
4

bitcoin-cli can read rpcuser and rpcpassword out of your config file. Just run it like this:

bitcoin-cli -conf=/Users/varunvb/Downloads/bitcoin.conf -datadir=/Users/varunvb/Downloads getinfo

Also, remove the -e from your bitcoin.conf.

| improve this answer | |

Your Answer

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

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