3 ms·
# Append the hidden service configuration to the Torrc file echo -e "HiddenServiceDir /var/lib/tor/onion-ssh/\nHiddenServicePort 22 127.0.0.1:22" > /etc/tor/t
by berbec 8y ago
# Append the hidden service configuration to the Torrc file
echo -e "HiddenServiceDir /var/lib/tor/onion-ssh/\nHiddenServicePort 22 127.0.0.1:22" > /etc/tor/torrc
Unless the '>' is changed to ">>", this will overwrite the torrc file.
- jstanley 8y agoThe default ubuntu torrc has everything commented out so is effectively blank anyway. Using ">" instead of ">>" means you don't end up with multiple copies of the same hidden service. That said, I agree: it should append, but it should first check whether it has already added a hidden service to the file.
- NickBusey 8y agoExactly, for simplicity since nothing is in there by default, it gets overwritten. To keep the script nice and short I decided not to add that detection. I would happily merge the change if someone decides they care enough to add it.