<p>You can't. The cookie file is for bitcoind to write it's automatically generated credentials to for other software to read. If you want to set the RPC credentials, you need to do so within the bitcoin.conf file using the <code>rpcauth</code> option (or <code>rpcuser</code> and <code>rpcpassword</code> but these are deprecated). These could also be specified on the command line.</p>

CC BY-SA 4.0
2020-11-13T20:56:45.830Z
2020-11-13T20:56:45.830Z
Ava Chow
<p>I'm running bitcoind 0.20.1 inside a Docker container and would like to access its RPC interface from another container. I have put an authentication cookie into a Docker secret and mapped it to <code>/run/secrets/rpc_cookie</code>. Now when I use <code>-rpccookiefile=/run/secrets/rpc_cookie</code> bitcoind tries to <em>write</em> to that file and fails. Of course, it's read-only! How can I instruct bitcoind to just use the cookie from the file and be done with it?</p>

<bitcoind><json-rpc><authentication>
Bitcoind to use static RPC authentication cookie from file?
Andreas
# Bitcoind to use static RPC authentication cookie from file?

(Asked by: username_0 on 2020-11-13)

I'm running bitcoind 0.20.1 inside a Docker container and would like to access its RPC interface from another container. I have put an authentication cookie into a Docker secret and mapped it to `/run/secrets/rpc_cookie`. Now when I use `-rpccookiefile=/run/secrets/rpc_cookie` bitcoind tries to *write* to that file and fails. Of course, it's read-only! How can I instruct bitcoind to just use the cookie from the file and be done with it?

**Tags:** bitcoind, json-rpc, authentication


---

## 1 answers

### Answer by username_1 on 2020-11-13. Score: 2

You can't. The cookie file is for bitcoind to write it's automatically generated credentials to for other software to read. If you want to set the RPC credentials, you need to do so within the bitcoin.conf file using the `rpcauth` option (or `rpcuser` and `rpcpassword` but these are deprecated). These could also be specified on the command line.


---

