Keyturn docsStart here

Set up your machine

Connect with your email address

Put keyturn anywhere on your PATH, then connect once. Keyturn finds the first server through DNS, asks you to confirm its certificate fingerprint (the way SSH asks about a new host), and then trusts the rest of the domain's servers because the Directory vouches for them. It saves one profile per server, pinned to that server's certificate, and a group called domain with all of them.

$ keyturn connect pat.doe@acme.example
$ keyturn server list
keyturn connect asking to trust the first server's certificate fingerprint
Trust once. The first server's fingerprint is shown; you type yes. keyturnd prints the same fingerprint on its load line.
keyturn connect saving three pinned profiles
Every server found. Three profiles saved and pinned, and your home server made the current one.
keyturn server list showing the domain's servers
keyturn server list afterwards: the domain's servers, read from the Directory.
WhenRun
No SRV recordkeyturn connect "Pat Doe/Acme" --host mail1.acme.com
New servers were addedkeyturn connect --refresh (it never changes a pin)
A server got a new certificatekeyturn connect --repin mail2
Use one server--server mail2 or --context mail2 on any command
Use every server--context-group domain
See your profileskeyturn meta context list, keyturn meta context current
Set one up by handkeyturn meta init --server https://mail1.acme.com:8129 --ca acme-ca.pem --user "Jane Doe/Sales/Acme"
Make your own server groupkeyturn meta context group add mail-servers mail1
Check what this machine can reachkeyturn meta doctor

Profiles never hold a password. Keyturn asks for your Internet password at the terminal, or reads $KEYTURN_PASSWORD.

Enroll in the second factor

Do this once per server, at your own terminal. Any RFC 6238 authenticator works (Microsoft or Google Authenticator, 1Password, and so on).

$ keyturn auth enroll --server mail1
# asks your Internet password, shows an otpauth:// key once, then asks the app's first code
$ keyturn auth whoami          # who you are on the server, and your second factor's state
$ keyturn auth recovery-codes regenerate

From then on a change takes --otp 123456, or asks for the code at the prompt. Each code works once. Reads never need one.

Tip

If your authenticator has a command line, give Keyturn --otp-cmd 'otp $SERVER'. Keyturn runs it right before each server's change, so a run across three servers fetches three codes without you typing them, and the codes are never printed.

Shell completion

$ keyturn meta completion zsh > ~/.zfunc/_keyturn