Force Tor to Use a Specific Entry Guard

You can manually force the Tor client to connect through a specific entry guard by editing your local Tor configuration file (torrc). By setting specific directives such as EntryNodes alongside StrictNodes, you can restrict Tor from building circuits through any initial hop other than the one you designate. While this capability is built into the Tor software, utilizing it overrides the network’s automated path-selection algorithms, making it critical to understand both the configuration process and the security implications involved.

How to Manually Set an Entry Guard

To configure a dedicated entry node, you need the relay’s unique fingerprint or IP address and access to your torrc file.

  1. Obtain the Relay Fingerprint: Find the 40-character hexadecimal fingerprint of the desired relay using tools like the official Tor Relay Search metrics platform. Using the fingerprint is strongly recommended over relay nicknames, as fingerprints are unique and cannot be spoofed.

  2. Locate the torrc File:

    • Tor Browser (Windows): Browser\TorBrowser\Data\Tor\torrc
    • Tor Browser (macOS): ~/Library/Application Support/TorBrowser-Data/Tor/torrc
    • Tor Browser (Linux): tor-browser_en-US/Browser/TorBrowser/Data/Tor/torrc
    • Standalone Tor Daemon (Linux/Debian): /etc/tor/torrc
  3. Add the Configuration Directives: Open the torrc file in a text editor and add the following lines at the bottom:

    EntryNodes $XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    StrictNodes 1

    Replace the X characters with the actual 40-character fingerprint of the guard node, keeping the $ prefix.

    • EntryNodes: Specifies the preferred node or list of nodes for the first hop.
    • StrictNodes 1: Forces Tor to strictly use the nodes listed in EntryNodes. If set to 0, Tor will attempt to use your specified node but may fall back to other guards if your chosen node is unavailable.
  4. Restart Tor: Save the file and restart the Tor service or Tor Browser to apply the changes.


Understanding the Risks and Trade-offs

Tor’s default behavior relies on rotating through a small set of randomly assigned, long-term entry guards. This mechanism protects users against profiling and traffic correlation attacks. Manually choosing your entry guard alters these protections in the following ways: