Skip to content

ts logout

Discard the ticket ts stored for a server. Add --revoke when the ticket may have been exposed and you want it to stop working everywhere, not just on this machine.

Usage

text
ts logout [--revoke]

Description

ts logout deletes the stored ticket for the targeted server and nothing else. It is a local operation, so it works while the server is down, and it leaves the ticket itself valid until it expires on its own.

Logins are per server. ts logout only affects the server the invocation targets — the stored default, or whatever --server and TSSERVER point at — so signing out of staging leaves production signed in.

--revoke calls the server first and stamps a cutoff on your account, which invalidates every login ticket issued to it. That covers other workstations, other terminal windows, and any Administration site session you left open. API keys and device keys are not touched; they have their own revocation, through ts api-keys and ts device-key.

The revoke call happens before the local ticket is deleted. If the server cannot be reached, the command fails and the stored ticket stays where it is, so you can retry once the server is back — or run plain ts logout to clear the local copy in the meantime.

Options

FlagDescriptionDefault/ValuesNotes
--revokeAlso invalidate every login ticket for the account, server-side.Requires the server to be reachable. Does not affect API keys or device keys.

Examples

bash
# Forget the stored ticket for the default server
ts logout

# Sign out of one server without disturbing the others
ts --server=https://staging.example.net logout

# A laptop was lost: stop every ticket for this account, everywhere
ts logout --revoke

Revoking signs you out of the Administration site too, and out of any other machine you are signed in on. Use it deliberately, not as a tidier ts logout.

Output

text
Logged out of turbo.example.net

With --revoke:

text
Logged out of turbo.example.net and revoked all tickets for the user

Exit Codes

0 on success. -1 when there is no stored login for the targeted server, or when no server is configured at all. -3 with --revoke when the server cannot be reached — in that case nothing was revoked and the local ticket is still stored.

  • ts login — The other half; stores the ticket this command discards.
  • ts status — Confirm which server ts is pointed at before signing out of it.
  • ts api-keys — Unattended credentials, revoked separately.