Created
July 12, 2019 21:16
-
-
Save brakmic/2454988ea12254bd623f66b084ce54a0 to your computer and use it in GitHub Desktop.
tor systemd script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Anonymizing overlay network for TCP | |
After=network.target nss-lookup.target | |
[Service] | |
Type=notify | |
NotifyAccess=all | |
PIDFile=/var/run/tor/tor.pid | |
PermissionsStartOnly=yes | |
ExecStartPre=/usr/bin/install -Z -m 02750 -o debian-tor -g debian-tor -d /var/run/tor | |
ExecStartPre=/usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0 --verify-config | |
ExecStart=/usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0 | |
ExecReload=/bin/kill -HUP ${MAINPID} | |
KillSignal=SIGINT | |
TimeoutSec=45 | |
Restart=on-failure | |
LimitNOFILE=65536 | |
# Hardening | |
PrivateTmp=yes | |
PrivateDevices=yes | |
ProtectHome=yes | |
ProtectSystem=full | |
ReadOnlyDirectories=/ | |
ReadWriteDirectories=-/var/lib/tor | |
ReadWriteDirectories=-/var/log/tor | |
ReadWriteDirectories=-/var/run | |
CapabilityBoundingSet=CAP_SETUID CAP_SETGID CAP_NET_BIND_SERVICE CAP_DAC_OVERRIDE CAP_CHOWN CAP_FOWNER | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment