change ownership to for running as caddy user but keeping the rest as sysadmin

giskard
David Kebler 2020-05-18 13:44:22 -07:00
parent a31117a7a9
commit ab07d9c4a4
3 changed files with 5 additions and 3 deletions

View File

@ -4,3 +4,5 @@ DIR=$(dirname "$(dirname "$(readlink -f "$0")")") || exit
echo Making Link to $ARCH binary in $DIR/bin/$ARCH/caddy
rm $DIR/caddy
ln -s $DIR/bin/$ARCH/caddy $DIR/caddy
sudo chown caddy:sysadmin $DIR/bin/$ARCH/caddy
sudo chown -h caddy:sysadmin $DIR/caddy

View File

@ -13,8 +13,8 @@ sudo useradd --system \
--comment "Caddy web server" \
caddy
sudo passwd caddy
sudo chown caddy:caddy -R /opt/caddy
sudo usermod -a -G caddy sysadmin
source /opt/caddy/scripts/own
sudo chmod g+rw -R /opt/caddy
cat /etc/passwd | grep caddy
cat /etc/passwd | grep sysadmin

View File

@ -1,4 +1,4 @@
#!/bin/bash
sudo chown caddy:caddy -R /opt/caddy
sudo chown caddy:sysadmin -R /opt/caddy/conf
sudo chown caddy:sysadmin /opt/caddy
sudo chmod g+rw -R /opt/caddy