(Note that `server_host` can be an IP address. IPv4 will work, IPv6 is
untested)
(**XXX Can it be 127.0.0.1 ???**)
At this point you are done on mach-client for now. You should verify that the
configuration is most likely valid by running a simple sbws command and seeing
if it complains. The following indicates there is no problem.
$ sbws
usage: sbws [-h] [-v] [-q] [-d DIRECTORY]
{client,generate,init,pwgen,server,stats} ...
[ ... more help output ... ]
While the following indicates there is an issue in your config.
$ sbws
[2018-04-06 08:38:29.122616] [error] [MainThread] client/nickname (Bad_NickName): Letter _ at position 3 is not in allowed characters "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
[2018-04-06 08:38:29.122678] [error] [MainThread] helpers.mine is an enabled helper but is not a section in the config
**On mach-server** ...
Recall that mach-server is the machine running a Tor relay and the one were we
are about to set up an sbws server.
Minor modifications need to be made to the relay's torrc. Assuming this is a
non-exit relay and you do not want that to change, we need to allow exiting to
a single IP and port, and that IP is on the local machine. This requires a few
torrc options.
# Modifications needed for a non-exit sbws helper relay
ExitRelay 1
ExitPolicyRejectPrivate 0
ExitPolicy accept 33.33.33.33:31648
ExitPolicy reject *:*
# End modifications needed for a non-exit sbws helper relay
Replace `33.33.33.33` with the IP address of this machine. (**XXX can
localhost be used?**)
If this is an exit relay, you will still need to set
`ExitPolicyRejectPrivate 0` and allow exiting to a local IP address on a single
port; however, *you should take care to block exiting to the rest of local
address space*. By default Tor would do that for you, but you must now do it
manually. The exit part of your torrc should look something like this.
# Exit relay config with modifications needed to run an sbws helper relay
ExitRelay 1
ExitPolicyRejectPrivate 0
ExitPolicy reject 0.0.0.0/8:*
ExitPolicy reject 169.254.0.0/16:*
ExitPolicy reject 127.0.0.0/8:*
ExitPolicy reject 192.168.0.0/16:*
ExitPolicy reject 10.0.0.0/8:*
ExitPolicy reject 172.16.0.0/12:*
[ ... Your usual ExitPolicy options should be here, then ... ]
ExitPolicy accept 33.33.33.33:31648
ExitPolicy reject *:*
# End exit relay config and modifications needed for an exit sbws helper relay
Again, replacing `33.33.33.33` with the IP address of this machine.
(**XXX can localhost be used?**)
Once you are done editing your torrc, reload Tor. Make sure Tor is still
running.
It's finally time to get to configuring sbws. Open its config file, located at
`~/.sbws/config.ini` by default. *If this directory or file does not exist,
you probably haven't initialized sbws or something went wrong when you did. The
file should not be empty.*
Add a `[server]` section to the config and tell sbws to bind to the IP address
for this machine.
[server]
bind_ip = 33.33.33.33
**XXX Again, can this be localhost?**
Now it's time to tell the sbws which clients we want to allow to use our
server. Gather the 64 character passwords from all the clients you want to
allow and add them to a new `[server.passwords]` section.
[server.passwords]
alice = joyrsUxkpvrlt6ZNxXyP4stdMGohZ5OwyqawvMhevzKq2gDFYjWUSsxMQeG5iIRY
bob = Ll22MSLm1DOGYXw74c2vyCbnLtRidgaAb7pAOLua62pYoAx8PsTsaC3BN7QUdD4N