Very simple question that I guess will have a very simple answer I’m overlooking.
If I have a running hidden service, how can I change the onion address?
To be clear, I don’t want a vanity address or anything particular.
I just want to know the easiest way to change the onion address that serves that hidden service.
Here are some options to change the onion address of your onion service:
a) Move or rename your onion service directory: You can relocate your current onion service directory to a new directory, such as /var/lib/tor/hidden_service-old.
b) Caution: If you do not have a backup of your onion service key material, this option will delete your onion service key and result in permanent data loss. Delete the hidden_service directory (or your onion services directory) and restart tor. This will generate a new onion service key.
c) Create a new onion services in your torrc configuration file:
## New directory for the new onion service
HiddenServiceDir /var/lib/tor/my_new_onion/
## Add a ServicePort for the new onion service
HiddenServicePort 80 127.0.0.1:80
Thanks for the help. Just testing, so no data at risk, appreciate the warning. I’ve managed to change it.
What I’m trying to understand is, when key-pairs get created. Is this on restart?
If I have a service set up in torrc and delete the contents of its corresponding directory at d/var/lib/tor/hidden_service_*restart tor, then tor rebuilds the key-pair and assign a new hostname?
And renaming a service in torrc assigns the service to a new directory, leaving you free to recreate a new service at the original designation /hidden_service_* and a new hostname onion address?
… but if nothing changes in torrc then the keys remain in the directory, unchanged?
I don’t think the current Tor daemon automatically deletes old Onion Service folders not listed in the configuration, but anyway the warning still applies: make sure to backup your keys before doing configuration changes.