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

<pre><code>bitcoin-cli -conf=/Users/varunvb/Downloads/bitcoin.conf -datadir=/Users/varunvb/Downloads getinfo
</code></pre>

<p>Also, remove the <code>-e</code> from your bitcoin.conf.</p>

CC BY-SA 3.0
2015-01-13T01:46:31.263Z
2015-01-13T01:46:31.263Z
Nick ODell
<p>I run it like the below.</p>

<pre><code>bitcoind -datadir=/Users/varunvb/Downloads -conf=/Users/varunvb/Downloads/bitcoin.conf -daemon
</code></pre>

<p>When I run (Using the user name and password as in the config file)</p>

<pre><code>bitcoin-cli -rpcuser=&lt;USER&gt; -rpcpassword=&lt;PWD&gt; getinfo
</code></pre>

<p>I get 
error: <code>incorrect rpcuser or rpcpassword (authorization failed)</code></p>

<p>I see the below in the debug log</p>

<pre><code>ThreadRPCServer incorrect password attempt from 127.0.0.1
</code></pre>

<p>My bitcoin.conf file looks like this:</p>

<pre><code>-e
rpcuser=&lt;USER&gt;
rpcpassword=&lt;PWD&gt;
</code></pre>

CC BY-SA 3.0
2015-01-12T16:59:22.090Z
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
CC BY-SA 3.0
2015-01-12T17:13:05.963Z
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
CC BY-SA 3.0
2015-01-12T18:45:54.923Z
@GeorgeKimionis removing -e form the config worked! Thanks!
Ani
CC BY-SA 3.0
2015-01-12T18:46:10.400Z
@NickODell I supply the directory as a command line parameter and it works fine. Thanks!
Ani
<bitcoind><client>
bitcoin-cli fails with auth error
Ani
# bitcoin-cli fails with auth error

(Asked by: username_0 on 2015-01-12)

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= -rpcpassword= 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=
rpcpassword=

**Tags:** bitcoind, client

> **Comments:**
> **username_0**: 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  
> **username_1**: bitcoin-cli can read rpcuser and rpcpassword out of your config file. Just pass `-conf=/Users/varunvb/Downloads/bitcoin.conf` to bitcoin-cli.  
> **username_0**: @GeorgeKimionis removing -e form the config worked! Thanks!  
> **username_0**: @NickODell I supply the directory as a command line parameter and it works fine. Thanks!  

---

## 1 answers

### Answer by username_1 on 2015-01-13. Score: 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.


---

