From 64ad539c76ecc5f6f61fd4b07cd6d6954eb402fb Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sat, 1 Feb 2020 21:58:23 +0000 Subject: [PATCH] don't run meshcentral as root --- install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index d989f25e..ebade893 100755 --- a/install.sh +++ b/install.sh @@ -79,8 +79,9 @@ sudo systemctl restart mongod print_green 'Installing MeshCentral' sudo mkdir -p /meshcentral/meshcentral-data +sudo chown ${USER}:${USER} -R /meshcentral cd /meshcentral -sudo npm install meshcentral +npm install meshcentral cd /home/${USER} sudo chown ${USER}:${USER} -R /meshcentral @@ -531,11 +532,11 @@ After=nginx.service [Service] Type=simple LimitNOFILE=1000000 -ExecStart=/usr/bin/node /meshcentral/node_modules/meshcentral +ExecStart=/usr/bin/node node_modules/meshcentral Environment=NODE_ENV=production WorkingDirectory=/meshcentral -User=root -Group=root +User=${USER} +Group=${USER} Restart=always # Restart service after 10 seconds if node service crashes RestartSec=10