<p>re-compiled on an Ubuntu system, fresh from github.com:</p>

<pre><code>$ uname -a
Linux ubuntu-ae 4.10.0-19-generic

$ bitcoind -version
Bitcoin Core Daemon version v0.15.99.0-g96ac26e5662

$ bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getaccountaddress "myaccount"
n2r1aQiA37LLgy4qWjuLHXqA9ZhtcX4KG6

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getbalance
0.00000000
</code></pre>

<p>and with wrong password:</p>

<pre><code>$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=1234564 getbalance
error: incorrect rpcuser or rpcpassword (authorization failed)
</code></pre>

<p>so s.th. is wrong with the sources? Or with Ubuntu setup. What kernel do you have (uname -a) ?</p>

CC BY-SA 3.0
2017-09-22T02:57:55.867Z
just compiled the newest version. Here is my command
$ bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456
bitcoin-cli -testnet getbalance
It just work! Wierd.
user2813549
CC BY-SA 3.0
2017-09-13T22:41:12.097Z
2017-09-13T22:41:12.097Z
pebwindkraft
<p>In case you changed your <code>/etc/systemd/system/bitcoind.service</code> make sure you run</p>
<pre><code> sudo systemctl stop bitcoind
 sudo systemctl daemon-reload
 sudo systemctl start bitcoind
</code></pre>
<p>to apply the changes.</p>
<p>The error from the question could (and did in my case) arise because I did not use <code>daemon-reload</code> to load the new config.</p>

CC BY-SA 4.0
2020-11-15T23:20:30.303Z
While this advice may be useful, the question doesn't ask anything about systemd or with changing systemd service files.
Ava Chow
CC BY-SA 4.0
2020-11-16T15:52:16.697Z
The error from the question could (and did in my case) arise because I did not use `daemon-reload` to load the new config. Since this solved my problem - which was the same as OPs -  I thought it would be a good thing to know.
bomben
CC BY-SA 4.0
2020-11-06T21:15:25.893Z
2020-11-16T15:51:56.237Z
2020-11-16T15:51:56.237Z
bomben
<p>When I run this command </p>

<pre><code>bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456
</code></pre>

<p>After bitcoind is up. I run this on the same Ubuntu 17.10</p>

<pre><code>bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getbalance
</code></pre>

<p>I get this result:
error: incorrect rpcuser or rpcpassword (authorization failed)
The second day I tried exactly the same way. I get the correct result. It is really weird.</p>

<p>I try to put these two lines in /home/user/.bitcoin/bitcoin.conf</p>

<pre><code>rpcuser=123456
rpcpassword=123456
</code></pre>

<p>And I run this command</p>

<pre><code>bitcoind -testnet -printtoconsole -conf=/home/gogogo237/.bitcoin/bitcoin.conf
</code></pre>

<p>And this </p>

<pre><code>bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=1234564 getbalance
</code></pre>

<p>notice that I intentionally changed -rpcpassword to a wrong password. But I still can get a correct result. 
This is really unpredictable and obviously a mistake. Anyone can explain this error? Thanks!</p>

CC BY-SA 3.0
2017-09-12T17:26:23.940Z
interesting, but for sure not the default behavious. I am normally on OpenSuSE. I have self compiled and downloaded full clients. Please provide some more info: did you use bitcoin core from website? Self compiled? apt-get? Did you check download files (hash)? 
I think I have a fresh Ubuntu virtual machine, where I could try to install the one you where using...
pebwindkraft
CC BY-SA 3.0
2017-09-13T07:04:15.277Z
Self compiled from the newest source code.
user2813549
CC BY-SA 3.0
2017-09-13T14:48:57.807Z
similiar discussion here, as bitcoin15 is not yet released: https://bitcointalk.org/index.php?topic=2172765.0. You downloaded from https://github.com/bitcoin/bitcoin?
pebwindkraft
CC BY-SA 3.0
2017-09-13T18:04:03.640Z
just downloaded from github, and couldn't compile, cause autoconf throws already some errors. And for sure ./configure as well. Damn, wanting to help, and now need help myself ...
pebwindkraft
CC BY-SA 3.0
2017-09-13T18:35:38.280Z
To avoid others doing same error (RTFM correctly, not in a rush): autogen.sh, not autoconf !! Now it's compiling. Update to follow.
pebwindkraft
<json-rpc><bitcoin-cli><authentication>
bitcoin-cli failed with error: incorrect rpcuser or rpcpassword
user2813549
# bitcoin-cli failed with error: incorrect rpcuser or rpcpassword

(Asked by: username_0 on 2017-09-12)

When I run this command

```
bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456

```

After bitcoind is up. I run this on the same Ubuntu 17.10

```
bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getbalance

```

I get this result:
error: incorrect rpcuser or rpcpassword (authorization failed)
The second day I tried exactly the same way. I get the correct result. It is really weird.

I try to put these two lines in /home/user/.bitcoin/bitcoin.conf

```
rpcuser=123456
rpcpassword=123456

```

And I run this command

```
bitcoind -testnet -printtoconsole -conf=/home/gogogo237/.bitcoin/bitcoin.conf

```

And this

```
bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=1234564 getbalance

```

notice that I intentionally changed -rpcpassword to a wrong password. But I still can get a correct result.
This is really unpredictable and obviously a mistake. Anyone can explain this error? Thanks!

**Tags:** json-rpc, bitcoin-cli, authentication

> **Comments:**
> **username_1**: interesting, but for sure not the default behavious. I am normally on OpenSuSE. I have self compiled and downloaded full clients. Please provide some more info: did you use bitcoin core from website? Self compiled? apt-get? Did you check download files (hash)?  I think I have a fresh Ubuntu virtual machine, where I could try to install the one you where using...  
> **username_0**: Self compiled from the newest source code.  
> **username_1**: similiar discussion here, as bitcoin15 is not yet released: https://bitcointalk.org/index.php?topic=2172765.0. You downloaded from https://github.com/bitcoin/bitcoin?  
> **username_1**: just downloaded from github, and couldn't compile, cause autoconf throws already some errors. And for sure ./configure as well. Damn, wanting to help, and now need help myself ...  
> **username_1**: To avoid others doing same error (RTFM correctly, not in a rush): autogen.sh, not autoconf !! Now it's compiling. Update to follow.  

---

## 2 answers

### Answer by username_1 on 2017-09-13. Score: 2 | Accepted answer

re-compiled on an Ubuntu system, fresh from github.com:

```
$ uname -a
Linux ubuntu-ae 4.10.0-19-generic

$ bitcoind -version
Bitcoin Core Daemon version v0.15.99.0-g96ac26e5662

$ bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getaccountaddress "myaccount"
n2r1aQiA37LLgy4qWjuLHXqA9ZhtcX4KG6

$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=123456 getbalance
0.00000000

```

and with wrong password:

```
$ bitcoin-cli -testnet -rpcuser=123456 -rpcpassword=1234564 getbalance
error: incorrect rpcuser or rpcpassword (authorization failed)

```

so s.th. is wrong with the sources? Or with Ubuntu setup. What kernel do you have (uname -a) ?

> **Comments:**
> **username_0**: just compiled the newest version. Here is my command $ bitcoind -testnet -printtoconsole -rpcuser=123456 -rpcpassword=123456 bitcoin-cli -testnet getbalance It just work! Wierd.  

---

### Answer by username_2 on 2020-11-06. Score: -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.

The error from the question could (and did in my case) arise because I did not use `daemon-reload` to load the new config.

> **Comments:**
> **username_3**: While this advice may be useful, the question doesn't ask anything about systemd or with changing systemd service files.  
> **username_2**: The error from the question could (and did in my case) arise because I did not use `daemon-reload` to load the new config. Since this solved my problem - which was the same as OPs -  I thought it would be a good thing to know.  

---

