Tokenman中文

Creating and removing accounts

A person needs two things to use Tokenman: to be able to sign in to the hub (to be on the Users list), and an account of their own on a machine (their sessions run in it, and their files and other people's cannot see each other). Creating an account gives them both; removing it takes both back.

Creating an account: send an invite

The usual road — one invite does both: they sign in to the hub with it, the hub adds them to the list and at once creates their account on a machine.

Web: the console's Users page → Invite command, and send them the line it prints.

Command line:

fleet hub invite alice          # only the GitHub user alice can use it; with no name, anyone holding it can use it once
fleet hub invite --list         # every invite and its state: unused · used · expired · revoked
fleet hub invite --revoke <id>  # revoke one that has not been used

Do not forget to grant subscriptions: a new user may use no subscription at all by default. Once they have signed in: Users page → choose them → subscription access, and pick "All subscriptions" or tick a few (Subscriptions and quota).

Self-hosted: all of the above; the machines also need room (Machines). Hosted: all of the above; we make sure the machines have room. Their row on the Users page shows the account's state; if it takes too long to be created, send us that row.

Let them sign in, without an account

Users page → Add user, and fill in a GitHub username; or fleet users add alice. They can sign in to the hub and see the console, but the first time they open a session they see "ask the hub's admin to give you a machine" until you create their account.

Create an account on a given machine for someone already registered (self-hosted)

fleet hub accounts                                   # each person's identity id (gh:<number>) and their accounts on each machine
fleet hub accounts assign gh:1234567 --host mac-a    # create one for them on mac-a

A person can have one account on each of several machines. A hosted customer who wants a second machine's account for someone asks us.

Removing an account

Removing is also two steps: stop them signing in, and take back their account on the machine.

1. Stop them signing in

Web: Users page → choose them → Remove user. Command line: fleet users remove alice.

It takes effect at once: their next request is refused, and every client of theirs (computers, phones) is revoked. But sessions they are running carry on until they close — to stop them now, do step 2. An admin written in the deployment configuration cannot be removed (take them out of the configuration and redeploy first).

2. Take back their account on the machine

fleet hub accounts remove gh:1234567 --host mac-a

Once per machine (fleet hub accounts shows which machines they have an account on).

Today this step is command line only; Remove user on the web does not do it. Coming: taking it back straight from the Users page.

Taking it back, the machine first stops all their sessions and background services, then does one of two things:

Hosted: the same command, run by you; the machine-side work is done by our machines themselves — no need to ask us.

What removing an account leaves behind

What staysWhereFor how long
An archive of their home directory (code copies, session transcripts, history)On that machine: /Users/Shared/offboarded/ on a Mac, /home/.attic/ on LinuxDeleted after 30 days on Linux; on a Mac it is not deleted automatically — an admin clears it by hand
Their identity record on the hubThe hubKept for good; invited back, they are the same person
The usage they ran upThe hubKept for good; it still counts in Usage by person
Audit recordsThe hubThe audit page shows the last 60 days
Branches and PRs already pushed to GitHubGitHubNot affected

Both recycling and deleting take away the machine's copy of the shared subscription before archiving the home directory, so the archive holds no subscription credential. On the hub side, their connection tokens, the claims they held and unused join codes are revoked before the account is taken back.

Self-hosted: to destroy the archive for good, delete its file on that machine (needs root). Hosted: the archive is on our machine; to have it destroyed early, tell us whose.

Common cases