error: Authorization failed: Incorrect rpcuser or rpcpassword 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
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.