<p>Have the users share a group, and write a wrapper it even a plugin to change the group and permissions on the rpc file. That's the normal Unix way...</p>

CC BY-SA 4.0
2019-03-16T21:15:56.267Z
I thought that maybe I can set the default group and permissions of the created lightning-rpc file in the config, but writing a wrapper to change it makes sense. Thank you Rusty!
francois
CC BY-SA 4.0
2019-03-12T08:30:07.137Z
2019-03-12T08:30:07.137Z
Rusty Russell
<p>I am not sure if I get your question. So just some general remarks. Lightningd  opens as socket and this owns the rpc file. That is why a 2nd lightningd needs a separate data dir and rpc file. However many clients can connect to the socket. For example lightning-cli or other programs you write....</p>

<p>If it is just about use rights you could probably just start lightningd with the Bitcoin user. Or you could assign the rpc file to be member of the same group as the Bitcoin user</p>

CC BY-SA 4.0
2019-03-05T16:32:53.643Z
2019-03-05T16:32:53.643Z
Rene Pickhardt
<p>Just give everyone to read bitcoin directory and rw RPC file:</p>

<pre><code>chmod a+rx .lightning/bitcoin/
chmod a+rw .lightning/bitcoin/lightning-rpc
</code></pre>

CC BY-SA 4.0
2020-02-03T21:39:52.450Z
And the `hsm_secret` would be widely readable ! Please don't do this.
Antoine Poinsot
CC BY-SA 4.0
2020-02-03T16:28:25.253Z
2020-02-03T16:28:25.253Z
pianisteg
<p>I'm using user "lightning" to start the daemon, but would like to have user "bitcoin" to make the lightning-cli calls. How do I share the lightning-rpc file to do so?</p>

<p>Thanks!
Francois</p>

<lightning-network><core-lightning>
Sharing the lightning-rpc socket
francois
# Sharing the lightning-rpc socket

(Asked by: username_0 on 2019-03-05)

I'm using user "lightning" to start the daemon, but would like to have user "bitcoin" to make the lightning-cli calls. How do I share the lightning-rpc file to do so?

Thanks!
username_0

**Tags:** lightning-network, core-lightning


---

## 3 answers

### Answer by username_1 on 2019-03-12. Score: 2

Have the users share a group, and write a wrapper it even a plugin to change the group and permissions on the rpc file. That's the normal Unix way...

> **Comments:**
> **username_0**: I thought that maybe I can set the default group and permissions of the created lightning-rpc file in the config, but writing a wrapper to change it makes sense. Thank you username_1!  

---

### Answer by username_2 on 2019-03-05. Score: 1

I am not sure if I get your question. So just some general remarks. Lightningd opens as socket and this owns the rpc file. That is why a 2nd lightningd needs a separate data dir and rpc file. However many clients can connect to the socket. For example lightning-cli or other programs you write....

If it is just about use rights you could probably just start lightningd with the Bitcoin user. Or you could assign the rpc file to be member of the same group as the Bitcoin user


---

### Answer by username_3 on 2020-02-03. Score: -1

Just give everyone to read bitcoin directory and rw RPC file:

```
chmod a+rx .lightning/bitcoin/
chmod a+rw .lightning/bitcoin/lightning-rpc

```

> **Comments:**
> **username_4**: And the `hsm_secret` would be widely readable ! Please don't do this.  

---

