I am trying to use my own custom .onion address using eschalot and after I add my info to hostname and key info into the private key file, upon starting tor, it overwrites my custom address and adds a tor generated address.

I tried setting

HiddenServiceVersion 3


HiddenServiceVersion 2

and it still overwrites the hostname file.

I tried setting the immutable bit on the hostname file and my private key using

chattr +i /etc/tor/hidden_service/hostname

and then tor fails to start with error

Mar 28 13:48:10.000 [debug] check_private_dir(): stat()ing /etc/tor/hidden_service/
Mar 28 13:48:10.000 [debug] file_status(): stat()ing /etc/tor/hidden_service//hs_ed25519_secret_key_encrypted
Mar 28 13:48:10.000 [debug] tor_rename(): Renaming /etc/tor/hidden_service//hostname.tmp to /etc/tor/hidden_service//hostname
Mar 28 13:48:10.000 [warn] Error replacing "/etc/tor/hidden_service//hostname": Operation not permitted
Mar 28 13:48:10.000 [warn] Could not write onion address to hostname file "/etc/tor/hidden_service//hostname"
Mar 28 13:48:10.000 [warn] Error loading rendezvous service keys

What's the switch to prevent tor from overwriting your hostname file?

1 Answer 1


Solution from irc.oftc.net #tor

User error. You don't add the .onion address to the hostname file.

I deleted all tor generated keys, deleted the hostname file and put the proper key into the keyfile

I also set

HiddenServiceVersion 2

Upon starting tor, it generated the correct custom .onion address into the hostname file and worked like a champ.

I was trying to force it and that made tor mad. Just don't force it.

  • > You don't add the .onion address to the hostname file. Says who? If I don't create it myself, Tor creates a name on its own and it has .onion in it.
    – whatever
    Dec 22, 2022 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .