Resetting and Cleaning a Tor Hidden Service (Complete Guide)
Written by Aryan Giri
π§ Why Reset Tor?
When working with Tor hidden services in labs or projects, you may need to:
- Remove an old
.onionaddress - Fix broken configurations
- Start fresh with a clean setup
- Rotate identity for testing
π Important:
.onion address = cryptographic identity
Deleting it = generating a completely new identity.
βοΈ Step 1 β Stop Running Services
Stop your local server
If you started a server (like Python HTTP):
Ctrl + C
Stop Tor service
sudo systemctl stop tor@default
Explanation:
- Stops the active Tor instance
- Prevents further network activity
Kill leftover processes (optional but recommended)
sudo pkill -f tor
Explanation:
- Ensures no Tor processes are still running in background
- Useful if something is stuck
βοΈ Step 2 β Remove Hidden Service Directory
sudo rm -rf /var/lib/tor/reverse_shell
Explanation:
This directory contains:
hostnameβ your.onionaddressprivate_keyβ identity key
Deleting it will:
- β Remove your current onion address
- β Delete identity permanently
- β Force Tor to generate a new one
βοΈ Step 3 β Start Tor Again (Fresh State)
sudo systemctl start tor@default
Get New Onion Address
sudo cat /var/lib/tor/reverse_shell/hostname
Explanation:
- A brand new
.onionaddress is created - Old one is completely invalid
βοΈ Optional β Disable Tor on Boot
sudo systemctl disable tor@default
Explanation:
- Prevents Tor from starting automatically
- Good for lab environments
β οΈ Common Mistakes
β Forgetting to stop Tor before deleting
May cause:
- Permission issues
- Directory recreation errors
β Not matching service port
If config is:
HiddenServicePort 5555 127.0.0.1:5555
Then:
- Your service MUST run on port
5555 - You MUST access:
onion:5555
β VPN interference
If using Cloudflare Warp or similar:
warp-cli disconnect
Tor routing can break with VPN overlays.
π§ What You Learned
You now understand how to:
- Stop Tor safely
- Remove hidden services
- Reset onion identity
- Start fresh clean environments
βοΈ Real-World Insight
Resetting a hidden service is similar to:
- Rotating infrastructure
- Burning exposed endpoints
- Rebuilding secure channels
This is a core skill in:
- Cybersecurity labs
- Privacy engineering
- Red team simulations
π Final Thought
If you can create a hidden serviceβ¦
You must also know how to destroy and rebuild it.
Thatβs real control.