This question already has an answer here:
I am running a
geth node with a number of RPC and WS options available.
In looking at the logs, I am seeing attempted connections from random IP addresses. They look as follows:
TRACE[02-17|22:19:32.930] Accepted connection addr=xx.xxx.xx.xx:xxxxx
Is this safe? Is it ok to allow people to access my node? What if I have RPC options available? Can they make those calls? Can they access my accounts?
If this is not safe, how can I not allow people in? I tried using
netrestrict to only allow myself in, but then I could not connect to any peers (and thus got no new blocks).