Using zerotier-cli
The command line interface is installed as zerotier-cli on Macintosh, Linux, and BSD.
On Windows systems the command line interface can be invoked from an administrator-privileged command prompt using the -q option of the zerotier-one_x86.exe or zerotier-one_x64.exe binaries ("-q <command>" instead of just the command). These can be found in C:\ProgramData\ZeroTier\One.
To get a list of commands, run:
sudo zerotier-cli help
This will print a list of command line switches and commands.
Commands are:
- info: displays the current computer's ZeroTier address, software version, and connection status
- listpeers: lists currently known peer computer addresses and other information
- listnetworks: lists networks to which you currently belong and their status
- join: join a network by 16-digit network ID
- leave: leave a network by 16-digit network ID
If a path such as /status or /network is specified instead of a command, that path is fetched from the API and the raw JSON result is printed. Raw JSON can also be shown with the -J option.
Authorizing a non-privileged user on Macintosh and Linux/BSD
On Linux, from the home directory of the user to authorize:
sudo cat /var/lib/zerotier-one/authtoken.secret >>.zeroTierOneAuthToken
chmod 0600 .zeroTierOneAuthToken
The file must be owned by the user you wish to authorize as well, so if you're not that user you'll need to sudo chown user:group .zeroTierOneAuthToken
.
On Macintosh the GUI (/Applications/ZeroTier One.app) will authorize the current user automatically if you run it and enter an administrator password. If you want to do it manually, it's just like above except the files are located in different places.
sudo cat '/Library/Application Support/ZeroTier/One/authtoken.secret' >>'Library/Application Support/ZeroTier/One/authtoken.secret'
chmod 0600 'Library/Application Support/ZeroTier/One/authtoken.secret'