aboutsummaryrefslogtreecommitdiffstats
path: root/config/hooks/tor-usergroup.sh.chroot
blob: e46ad1614ea4ff654c8e050a841ce2a6fdeab90f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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/*