diff --git a/README.md b/README.md index 7e64c9e..9ab8756 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,15 @@ sudo cp homeserverdns-daemon homeserverdns-update /usr/bin sudo cp homeserverdns.cfg /etc ``` -If we want to use systemd to control homeserverdns, we need to install the service file `homeserverdns.service`. We have to make sure that the path of the config file is correct in that file. +We create a user and adjust the permissions of the config file, so only that user can read it (and the credentials in it). + +```shell +sudo useradd --system homeserverdns +sudo chown homeserverdns:root /etc/homeserverdns.cfg +sudo chown 0600 /etc/homeserverdns.cfg +``` + +If we want to use systemd to control homeserverdns, we need to install the service file `homeserverdns.service`. We have to make sure that the path of the config file and the `User` variable are correct in that file. ```shell sudo cp homeserverdns.service /etc/systemd/system diff --git a/homeserverdns-update b/homeserverdns-update old mode 100644 new mode 100755 diff --git a/homeserverdns.service b/homeserverdns.service index dfaf0de..6b3ce2c 100644 --- a/homeserverdns.service +++ b/homeserverdns.service @@ -4,6 +4,6 @@ Description=DNS updater for home servers [Service] ExecStart=/usr/bin/env bash -c 'homeserverdns-daemon /etc/homeserverdns.cfg' +User=homeserverdns Group=nobody -User=nobody Type=simple