5

I just had a falling out with a programmer who originally installed my Hidden Service (xxxxxxxxxxxxxxxx.onion) hostname onto a Debian linux cloudhost.

I know it is basically changing my entire Domain so I'll have to tell users where to find me again, but I'd really like to change the hostname / privatekey out for a new one on my Wheezy server without jeapordizing any web files.

Do I have to log in as root? I can't seem to get into my hidden_services folder using the secure sudo user.

  • I'm not quite sure what you are trying on which machine. Could you describe which steps you did on which server (first or second one)? What command did you use in connection with sudo? what was the error message? – Jens Kubieziel Jun 23 '14 at 19:55
3

You are correct in the way you are doing it, what you can do is to remove the key\hostname file located where the hidden service stored it.

First make sure you are in the right folder by checking the torrc file,

nano /etc/tor/torrc

scroll down to where it says hidden services, check what folder your hidden service points to. When that's done you can get to that folder as 'root' and move the files out of there and (for example make a backup directory, then move the files)

mkdir /home/yourusername/backupTorHost

mv filename /home/yourusername/backupTorHost/

restart tor:

/etc/init.d/tor restart

And it will then create a new onion url and keyfile for your service, it will not touch your webfiles at all.

But please keep in mind that if your service is dependent on your URL then it can stop function (hardcoded urls, and urls that points to your old domain). That's why it's good to take a backup of the current domain \ keyfile so that you can revert if it goes wrong.

  • This was a great help but apparently it's incomplete. I found out the hard way that you also have to add your new URL to the nginx config file: /etc/nginx/sites-available/default -But even after stopping the nginx service & editing it as root I can't save this change! Man linux is crazy sometimes... – user52847 Jun 25 '14 at 0:36
  • 1
    It may also be worth noting that configuration changes in any web server you use (e.g. Apache, lighttpd, etc.) are likely to be needed. – Anaksunaman Jun 25 '14 at 5:18
2

you should create new onion domain with its private key.

Making Onion Domain

you will have to use software Shallot. If you have Linux at your home PC/Laptop, just install shallot (./configure && make) and use it (./shallot ^test).

If you use Windows, you will have to use virtualbox + linux iso file, and then install shallot. I chose bodhi linux iso file but it was the same case like debian and ubuntu, I had to install dependencies.

Shallot is located at: https://github.com/katmagic/Shallot

For installation on server, use wget command for downloading/grabbing files to the server:

wget https://github.com/katmagic/Shallot/archive/master.zip
unzip master.zip

(in my case I had to: sudo apt-get install zip unzip). Then you will get folder named Shallot-master, walk into that folder:

cd Shallot-master

Then configure and use it:

./configure
make

After that, you can use it, command is: ./shallot ^test But usually most of people will get "dependencies error", it means you must install g++ or c++, whatever else (you can try: sudo apt-get install build-essential). Therefore I rather chose to install Shallot at my home PC.

Beside it, I succeeded to make onion domain with 7 letters (as I wanted) in 2 hours. But general rule is: There are 14 signs in onion domain and shallot will make for you 3 signs as you want in 1 second, 4 in 2 seconds, 5 in 1 minute, 6 in 30 minutes, 7 in 1 day, 8 signs in 25 days, and so on.

When you get onion domain as you wanted, copy private key in file called hostname which is located at /var/lib/tor/hidden_service/ it should be like this:

/var/lib/tor/hidden_service/hostname

content of file should look like this: testvztz3tfoiofv.onion

second file should be:

/var/lib/tor/hidden_service/private_key

it should look like this:

-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQC3R85m6NQaA1ZjaYqvz1hvFIjbL4RtKdJbG8hlC9xEBkvfr/BG
8Z5vDiUzdbDt8mEBuZUDanx80uGJvbXTgmczX0UlkEOgGiZ8RKpnsbKaf/EJNrIw
T7MSXQmWNcm22nDeViV7fwy+Usyal2RE5cdVCFsPtEbVZqCumlKkEgCyFwIDBAZ7
AoGBAJSa2cGuru/XhzJAEAIwHZbgPDnum9T/srOYxUKW6afHZeOu5S4Cclwb+xb/
pGOtzn71XZfCKMfiVdxB/f3XTcRrYB2VnBoNToTD7WfH6DksdDf4zunqiEjvxi9K
R+tKhxmF7OedrRt8wIhUmFd1E2Q9nbTHI6icdB4kR4QkYKZzAkEA5M6samK7+495
6SWpRXiePIs7sHKWuxdCrG7kW5RNJrv2CcGYwK46TPcaXBcRfM4eq9+9PGoKi0IO
gSpOZ5vRYQJBAM0QAZYTZ6ApD014x372MX1ZNofuYL/+XF8ZPZV6Sh4+9MUBuNPb
yL7BENDr6pX4Zm6OepvAphhCa4vGno2pHncCQQCQnfhUCHANU4bjtX4EOoI63WDq
UwBOeIWxu0YvGt7Z25Dg9CNz/aX8UZIoj6VyKxLRbR9+K3mNrNgaopW+ZDKzAkEA
ttgTK1ALe+3v+5H+Ez1SvFPREDFcHihrfD1Ipc5zicY9ixTArgdyZvk+Pi+AMBVV
sL2HWvjRLEAgRclvKfkwWwJAFtM+BIGRM5me+fMALuBBEtKnbJ6maflsyucErEb0
pIIBkovF5oyWO3lSBmtStJIANNkHOg8aXqjcgPKusDN7CQ==
-----END RSA PRIVATE KEY-----

P.S. Scallion could also be used for the generation of hidden service hostname/key.
It is much faster than Shallot, but requires a GPU - https://github.com/lachesis/scallion

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.