How to Configure MyFamily on Tor Relays
Running multiple Tor relays helps scale the network, but it requires
operators to declare their nodes as a single group using the
MyFamily configuration. This article covers the purpose of
the Tor family setting, why it is critical for protecting user anonymity
against traffic correlation attacks, and the exact steps required to
implement mutual family declarations in the torrc
configuration file.
What is a Tor Relay Family?
The MyFamily setting is a directive in the Tor
configuration file (torrc) that tells Tor directory
authorities and clients that a specific set of relays is controlled by
the same person, group, or organization.
When a Tor client builds a three-hop circuit (Guard, Middle, and Exit relays) to browse the web, it selects relays randomly based on bandwidth and flags. If a single entity controls both the Guard relay (which sees the user’s real IP address) and the Exit relay (which sees the destination website), that entity could correlate traffic timing and deanonymize the user. By properly declaring a family, clients are instructed never to use more than one relay from that family in a single circuit.
How to Configure
MyFamily
To configure a family, you must add the MyFamily
configuration line to the torrc file of every relay you
operate.
1. Retrieve the Relay Fingerprint
Always use the relay’s 40-character cryptographic identity
fingerprint rather than its nickname, as nicknames are not guaranteed to
be unique. You can find your relay’s fingerprint in the
fingerprint file located in the Tor data directory
(typically /var/lib/tor/fingerprint on Linux) or by
checking your Tor logs on startup.
A standard fingerprint looks like this:
$2556487E136D74384D0223D9E9DF1D4F1E925EFD
2. Update the torrc
File
Open the torrc file on each of your relays and add the
MyFamily parameter, followed by a comma-separated list of
the fingerprints of all relays in your family.
For example, if you operate three relays (Relay A, Relay B, and Relay
C), the MyFamily configuration on all three
relays should look identical:
MyFamily $AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, $BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB, $CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
(Note: While you can include the relay’s own fingerprint in its
MyFamily list, it is optional; however, listing all relays
uniformly across all nodes simplifies configuration
management.)
3. Reload Tor Configuration
After editing the torrc file on each server, reload or
restart the Tor process to apply the changes:
sudo systemctl reload torKey Rules and Best Practices
- Mutual Declaration is Mandatory: Tor directory authorities enforce a strict mutual agreement policy. Relay A must list Relay B, and Relay B must list Relay A. If the declaration is one-sided, the directory authorities will reject the family relationship, and clients may end up using both relays in the same path.
- Keep the List Updated: Whenever you add a new relay
or decommission an existing one, you must update the
MyFamilyline across every active relay you operate. - Always Prefix with
$: When using 40-character hex fingerprints, prepend each hash with the$symbol so Tor correctly parses it as an identity key.