aboutsummaryrefslogtreecommitdiffstats
path: root/config/hooks/tor-usergroup.sh.chroot
diff options
context:
space:
mode:
Diffstat (limited to 'config/hooks/tor-usergroup.sh.chroot')
-rwxr-xr-xconfig/hooks/tor-usergroup.sh.chroot15
1 files changed, 15 insertions, 0 deletions
diff --git a/config/hooks/tor-usergroup.sh.chroot b/config/hooks/tor-usergroup.sh.chroot
new file mode 100755
index 0000000..e46ad16
--- /dev/null
+++ b/config/hooks/tor-usergroup.sh.chroot
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+export ADMINUSER="tor"
+export ADMINGROUP="tor"
+export TORADMINGROUP="debian-tor"
+
+# add users and groups (ignore failures if groups already exist)
+addgroup $ADMINGROUP
+useradd -g $ADMINGROUP -G $TORADMINGROUP -s /bin/bash $ADMINUSER
+# TODO: $ADMINUSER passwd?
+
+# give Tor permission to modify it's own configuration
+chgrp $TORADMINGROUP /etc/tor/ /etc/tor/*
+chmod g+rw /etc/tor/ /etc/tor/*
+