Which user should own files in /etc/pihole?

Please follow the below template, it will help us to help you!

Expected Behaviour:

When adding a new regex to the blacklist (via web interface), I expect the new regex to be saved.

Actual Behaviour:

get an error stating file permissions are wrong. All files in /etc/pihole are owned by root user.

Debug Token:

lot17f9zle

Mine are pihole:pihole and some are root:root

pi@noads:~ $ stat -c "%U %G %a %n" /etc/pihole/* | column -t
root    root      644  /etc/pihole/adlists.list
root    root      644  /etc/pihole/adlists.list.old
root    root      644  /etc/pihole/black.list
root    root      644  /etc/pihole/blacklist.txt
pihole  pihole    644  /etc/pihole/dhcp.leases
root    root      777  /etc/pihole/dnsmasq.d
root    root      644  /etc/pihole/dns-servers.conf
root    root      644  /etc/pihole/GitHubVersions
root    root      644  /etc/pihole/gravity.list
root    root      644  /etc/pihole/install.log
root    root      600  /etc/pihole/list.0.raw.githubusercontent.com.domains
root    root      600  /etc/pihole/list.1.mirror1.malwaredomains.com.domains
root    root      600  /etc/pihole/list.2.sysctl.org.domains
root    root      600  /etc/pihole/list.3.zeustracker.abuse.ch.domains
root    root      600  /etc/pihole/list.4.s3.amazonaws.com.domains
root    root      600  /etc/pihole/list.5.s3.amazonaws.com.domains
root    root      600  /etc/pihole/list.6.hosts-file.net.domains
root    root      600  /etc/pihole/list.7.dehakkelaar.nl.domains
root    root      600  /etc/pihole/list.8.gitlab.com.domains
root    root      644  /etc/pihole/list.preEventHorizon
root    root      644  /etc/pihole/localbranches
root    root      644  /etc/pihole/local.list
root    root      644  /etc/pihole/localversions
root    root      644  /etc/pihole/logrotate
root    root      644  /etc/pihole/macvendor.db
pihole  pihole    664  /etc/pihole/pihole-FTL.conf
pihole  pihole    644  /etc/pihole/pihole-FTL.db
root    root      644  /etc/pihole/pihole-FTL.db.bak
pihole  www-data  664  /etc/pihole/regex.list
root    root      644  /etc/pihole/setupVars.conf
root    root      644  /etc/pihole/setupVars.conf.update.bak
root    root      644  /etc/pihole/whitelist.txt

Thanks. I'll change the owner to pihole for the regex.list file and that'll be it!

1 Like

Dont forget group:

sudo chown pihole:www-data /etc/pihole/regex.list

And permissions:

sudo chmod 664 /etc/pihole/regex.list

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.