Sign out users, recover accounts, and remove users
Sign out users, reset accounts with lost passkeys, disable or remove users, and manage user configuration with Git.
Delete sessions to sign out users; reset accounts to restore access. To stop a user's access, disable the account first, then remove it when you no longer need it. You can also store User configuration in Git and manage it with GitOps.
Sign out users
Section titled “Sign out users”kubectl -n zeabur-identity get zbgrant -l identity.zeabur.com/user=alicekubectl -n zeabur-identity delete zbgrant -l identity.zeabur.com/user=aliceEach signed-in session is a Grant. These commands list and delete all sessions for alice.
After deletion, these sessions can no longer refresh tokens. Tokens the user already has remain valid until they expire, for up to 10 minutes.
Recover an account with a lost passkey
Section titled “Recover an account with a lost passkey”zeabur-identityctl setup-link --username alice --resetThis command deletes all credentials, sessions, and pending invitations for alice. Credentials include passkeys, passwords with their authenticator apps and recovery codes, and linked upstream accounts.
The command outputs a new single-use setup link that expires in 1 hour.
When the command issues the link, it adds a SetupLinkIssued event to the User. When someone uses the link, a SetupLinkRedeemed event is added.
For regular accounts, you can use an invitation instead:
zeabur-identityctl invite --username alice --resetThis command performs the same reset and outputs an invitation. The user can also use the invitation to link an upstream account.
Disable a user
Section titled “Disable a user”kubectl -n zeabur-identity patch zbuser alice --type=merge -p '{"spec":{"disabled":true}}'Disable the account before you remove the user. Once disabled, the user can't sign in, sessions can no longer refresh tokens, and setup links and invitations become invalid.
Disabling an account doesn't delete any data. Set disabled back to false to restore the account.
Run this command to check the status:
kubectl -n zeabur-identity get zbuser aliceThe Disabled column in the output shows true.
Permanently remove a user
Section titled “Permanently remove a user”kubectl -n zeabur-identity delete zbuser aliceAfter you delete the User, the user's passkeys, linked upstream accounts, sessions, and invitation links become invalid.
These objects are all tied to the original User's UID. Even if you create a User with the same name, the new object gets a new UID.
Tokens the user already has remain valid until they expire, for up to 10 minutes.
Kubernetes garbage collection deletes the related objects later. To delete them immediately, run this command before or after you delete the User:
for kind in zbcred zbgrant zbinvite; do kubectl -n zeabur-identity delete "$kind" -l identity.zeabur.com/user=alicedoneManage users with Git
Section titled “Manage users with Git”apiVersion: identity.zeabur.com/v1alpha1kind: Usermetadata: name: alice namespace: zeabur-identityspec: username: alice displayName: Alice Chen groups: [dev] # accountType: Admin # for an admin accountUser is a standard Kubernetes manifest that you can store in a GitOps repository.
Don't store Credential, Grant, or Invitation objects in Git. Zeabur Identity creates and deletes these objects. If a sync tool prunes them, it removes users' passkeys or signs users out.
To keep user data in sync with your company directory, see Sync users from a directory.