# Local Accounts

---

# Local Accounts

_Peios / Using Peios / Local Accounts_

> How local accounts, groups, credentials, and machine policy fit together.

Local accounts identify people and services known to this machine. The local
principal source is `lpsd`. It stores those accounts and checks their
credentials. Use `lps(1)` to administer the store through the daemon.

An account is one kind of principal: an identity that can receive access.
Groups collect principals so that access rules can name a group instead of
every member. Each local account and group has a security identifier (SID),
which remains the same when its name changes.

## Identity, credentials, and access

Three separate decisions determine a sign-in:

- **The account:** its name, SID, group memberships, and profile.
- **Its credentials:** the password or public keys it holds and the policy
  selecting which credentials it accepts.
- **Machine policy:** the privileges and integrity level that `authd`
  places on the resulting access token.

An access token records the identity and authority of a running process.
`lpsd` supplies identity information; `authd` grants the token. A source
cannot grant a privilege by adding it to an account's profile.

Changing a password and requiring that password are separate actions. For
example, setting a password on an account with the `none` credential policy
does not stop credential-free sign-in. Read [Managing
Credentials](/peios/using-peios/local-accounts/managing-credentials.md) before changing the
permitted methods.

## Choose the right tool

Use the tool for the task you need:

- **Inspect or administer local accounts:** use `lps` as an administrator.
- **Sign in at a terminal:** use the managed console's `login(1)` client.
- **Integrate an application:** use the
  [authentication client library](/peios/developing-for-peios/authentication-client/conversations.md).
- **Diagnose the daemons:** start with
  [Diagnosing Authentication](/peios/using-peios/authentication/diagnosing.md).

`lps` does not edit the store file directly. `lpsd` checks the caller's token,
applies the request, and saves the result. An ordinary signed-in account does
not acquire administrative rights by running the command.

## Changes and existing sessions

An account change affects later requests and tokens. Removing a group,
changing a password, or stopping an account from signing in does not rewrite
access tokens already issued to it.

For retiring an account, distinguish stopping further sign-ins from ending
existing work. Follow [Retiring an
Account](/peios/using-peios/local-accounts/retiring-an-account.md), and keep a working
administrator session while changing access.

For desktop administration, use [Principals
Manager](/peios/using-peios/local-accounts/principals-manager.md). Personal display names,
passwords, and keys are covered by [My
Settings](/peios/using-peios/local-accounts/my-settings.md). Those interfaces preserve the
same distinction between identity, credentials, and machine grants.

---

# Profiles and Claims

_Peios / Using Peios / Local Accounts_

> How account profile preferences differ from security claims on issued tokens.

A profile tells a client how to start a session. Claims describe account
attributes that access rules can evaluate. Both are stored with the account,
but they serve different purposes.

## Profile preferences

The profile includes a home path, shell path, and display name. An
administrator changes it with `lps set`. For example:

```sh
lps set alice --display-name "Alice Chen"
lps show alice
```

The display name is presentation text. It is not a credential, an account
lookup key, or evidence of a different identity. A person can change their own
display name through the self-service account interface.

Changing a home path does not move files. Changing a shell affects later
sessions rather than replacing a running shell. Use absolute paths for homes
and shells; `login` rejects a relative profile path and uses its fallback.

Renaming an account with `lps rename` is a separate action. The account's
security identifier (SID), group memberships, and recorded home remain
unchanged.

## Claims used in access decisions

A claim has a name, a value type, and one or more values. An administrator can
set a claim such as a department:

```sh
lps claim set alice Department string Engineering
lps show alice
```

The claim has an effect only where an access rule evaluates it. A string named
`Administrator` does not grant administrator membership or a privilege by
itself.

Claim names use per-character Unicode lowercase matching without normalization
or full case folding. Équipe and équipe name one claim; ß and ss do not.
Setting `department` replaces an
existing `Department` claim. A claim with no values remains present and is
different from removing the claim; access rules can distinguish the states.

Claims are copied into a token when it is issued. Changing a stored claim does
not change tokens that already exist. Test the intended access rule with a
fresh session after a claim change.

Octet claim values use pairs of ASCII hexadecimal digits. Invalid text,
including non-ASCII characters, produces a usage error without changing the
account.

The complete claim types and command syntax belong to `lps(1)`. The machine's
privilege grants are described separately in [Granting
Access](/peios/using-peios/authentication/granting-access.md).

---

# Sessions and Account Changes

_Peios / Using Peios / Local Accounts_

> Why account changes do not revoke existing tokens and what ending a session does.

A logon session groups work started with a granted identity. Its access tokens
contain the account information and machine policy evaluated when the tokens
were issued. Changing the stored account does not rewrite them.

## Stop new access and active work separately

Turning an account off, changing its password, removing a key, or removing a
group membership changes later authentication and token creation. A program
already running with a token can retain its previous access.

For an account retirement or suspected credential compromise, decide both
whether further sign-ins are permitted and whether existing sessions must end.
Neither action substitutes for the other.

## Ending a session

An authorized client asks `authd` to end a session. The authority finds
processes whose primary tokens belong to it, asks them to exit, and kills
survivors after a grace period. Repeated scans are bounded, so the result can
report processes that remain.

The kernel removes the session when its last token reference is released. An
external process holding a token reference can keep the session alive after
its ordinary processes have exited. Ending a session is not a promise that
every reference to its tokens has disappeared.

## Who can request it

A signed-in person can end their own eligible session. Ending another person's
session requires access granted by `SessionEndSecurity` under
`Machine\Generic\Authn\Policy`. SYSTEM, anonymous, and service sessions are
protected from this operation.

The library offers a permission query so an application can decide whether to
present an action. The actual request is checked again; a query is not a
reservation of authority.

If the requesting application belongs to the target session, authd replies
before ending its processes. Counts in that reply are prospective rather than
confirmed terminations. The application can disappear before it renders the
result.

Read `authd(8)` for termination behavior and the registry manual for
`Machine\Generic\Authn\Policy:SessionEndSecurity`. Application authors should
also read [Self-Service
Operations](/peios/developing-for-peios/authentication-client/self-service.md).

---

# Creating an Account

_Peios / Using Peios / Local Accounts_

> Create a local account, verify its profile, and check a fresh sign-in.

Create an account with `lps` when someone needs an identity held by this
machine. Account creation saves the identity and profile; the home directory
is prepared separately at sign-in.

## Before you start

Check these prerequisites:

- Use a session with active `Administrators` membership or authorized
  `LocalSystem` access.
- Confirm that `lpsd` is ready.
- Keep an existing administrator account available. These instructions
  do not provision a machine's first account.

## Create and inspect the account

Follow these steps:

1. Run the interactive account creator:

   ```sh
   lps add alice
   ```

   Replace `alice` with the account name. Supply the requested profile and
   password, review the proposed account, and confirm it. Leave additional
   groups empty unless the account needs them.

2. Inspect the saved account:

   ```sh
   lps show alice
   ```

   Check its state, credential policy, groups, home, and shell. An ordinary
   account defaults to `/home/alice` and `/bin/sh`. No matching per-user
   group is created automatically.

3. Keep your administrator session open and sign in as `alice` through a
   separate permitted console or client. Check that the intended shell
   starts and the home directory is accessible.

The final check tests the complete sign-in route. A saved account alone does
not prove that a client can reach the authority or collect its required
credentials.

## Administrator accounts

If the account must administer the machine, request the membership during
creation:

```sh
lps add alice --group Administrators
```

This grants access to local account administration. The separate [machine
policy](/peios/using-peios/authentication/granting-access.md) determines the
privileges on tokens issued to that group.

## Home directories

`lps` records the home path without creating the directory. When `authd`
grants a logon with a home path, it creates a missing home with access for the
account, `LocalSystem`, and administrators. The descriptor blocks inherited
grants from widening that access. The directory is created with that
descriptor, so it never exists without it. The parent directory must already
exist; authd creates the missing leaf, not a parent tree.

The shipped authd service retains `SeRestorePrivilege` to assign the new
home's owner and group. If it is removed from the service's
`RequiredPrivileges`, the kernel refuses the descriptor and no home is
created. The authority's diagnostics record the failure, and the logon starts
in `/`. Retrying a sign-in does not take over a directory that already exists.

An existing directory is left alone. Changing the recorded home does not move
files or repair its ownership. If home preparation fails, the logon can still
succeed; `login` reports an inaccessible home and starts in `/`.

Every kind of logon prepares the home by default, including network logons
such as file sharing, so a file server can offer users their homes. To limit
it, list the logon types that should prepare homes in
`Machine\Software\Authd ProvisionLogonTypes`. For the Windows behavior,
where a network logon creates no profile, leave out `Network` and
`NetworkCleartext`. The same setting governs the account's per-user Registry
root.

## The first account

On a machine with no store, `lpsd` creates an empty store and a machine
domain. It does not invent an administrator or a password. An image must
provide an authorized first-account setup route.

An installed image can use [first-boot
setup](/peios/first-boot/completing-setup.md). A custom image must enable that
service or provide another authorized provisioning route. A service that
uses `lps` to provision an account starts after lpsd is ready; an early boot
script running before the services cannot use its socket.

The optional `dev.peios.authd-live-account` package supplies a development
bootstrap. Its credential-free administrator is a deliberate image policy
choice, not a default for installed systems. Do not use that package to solve
ordinary account creation on a production machine.

For exact creation options, read `lps(1)`.

---

# Managing Credentials

_Peios / Using Peios / Local Accounts_

> Set passwords and public keys without confusing stored credentials with policy.

Manage an account's credential material and its permitted methods as two
separate steps. Adding a password or public key does not change which methods
`lpsd` accepts for that account.

## Before you start

Prepare an alternate access route:

- Use an administrator session for these `lps` commands.
- Keep a working administrator route open while changing another route.
  Verify a fresh sign-in before closing it.

Inspect the account first:

```sh
lps show alice
lps key list alice
```

Replace `alice` with the account name. Credential policy selects the accepted
proof:

| Policy | Accepted proof | Required material |
|---|---|---|
| `password` | Password | Stored password verifier |
| `key` | SSH public-key proof | Enrolled public key |
| `either` | Password or SSH public-key proof | Material for the chosen method |
| `none` | No credential | None |
| `denied` | No accepted method | None |

Missing material does not cause a fallback to another method. The client and
authority also constrain which method and kind of logon are allowed. The
terminal `login` client cannot perform an SSH public-key exchange.

## Require a password

Follow these steps:

1. Set the password through the prompt, keeping it out of command history:

   ```sh
   lps password alice
   ```

2. Select password authentication:

   ```sh
   lps policy alice password
   ```

3. Inspect `lps show alice`, then verify a fresh sign-in with that password.

Both steps are needed when replacing `none` policy. Setting the password alone
leaves credential-free sign-in permitted.

## Add a public key

Follow these steps:

1. Enroll the public key file:

   ```sh
   lps key add alice /path/to/alice.pub workstation
   ```

   Replace the path with a public key file. `workstation` is a descriptive
   label. Do not supply a private key. Supported keys and input restrictions
   are documented in `lps(1)`.

2. Inspect `lps key list alice` and compare the fingerprint with the key
   you intended to enroll.

3. If password access must remain available while checking the key, select
   both methods:

   ```sh
   lps policy alice either
   ```

4. Verify a fresh connection through an SSH service configured to use this
   authority. Only after that check, use `lps policy alice key` if the
   account must accept keys exclusively.

Enrolling a key does not configure an SSH server or make one reachable.

## Remove a key

Follow these steps:

1. Run `lps key list alice` and identify the key to remove.
2. Pass its listed key ID to `lps key remove alice <key-id>`.
3. Inspect the list again and verify the remaining sign-in route.

The administrative command takes the key ID, not its fingerprint. The public
library's self-service removal operation takes a fingerprint; do not
interchange the two interfaces.

Removing a key or changing policy invalidates pending SSH key proofs but does
not end existing sessions. Stopping active access is a separate [session
operation](/peios/using-peios/local-accounts/sessions-and-account-changes.md).

## Self-service changes

A person changing their own password or keys uses an authentication
conversation through `authd`, rather than the administrative socket. `lpsd`
requires an accepted current password for these operations. An account with
only a key, no credential, or no stored password needs an administrator's
help.

Application authors can use the [self-service client
operations](/peios/developing-for-peios/authentication-client/self-service.md).

---

# Managing Groups

_Peios / Using Peios / Local Accounts_

> Create a local group and change membership while preserving stable identities.

Use a local group when several accounts need the same access. The group has
its own security identifier (SID), so its name can change without changing the
identity named by access rules.

## Before you start

Check these prerequisites:

- Use an administrator session with access to `lpsd`.
- Create the account `alice` before following this example.

## Create a group and add a member

Follow these steps:

1. Create the group with a description:

   ```sh
   lps group create developers "Local development team"
   ```

2. Add the account:

   ```sh
   lps group add alice developers
   ```

3. Check `lps group list` and `lps show alice`. Verify the group and the
   account's membership before using the group in an access rule.

4. Start a fresh session for `alice` to receive a token with the changed
   membership. Existing tokens retain their previous groups.

Creating the group does not grant access to any file or service. Assign that
access separately using the resource's security policy.

## Name a group unambiguously

`lpsd` resolves a group name, a qualified built-in name, or a literal SID.
Well-known names such as `Administrators` take precedence over local names,
and local groups cannot take those reserved names.

For automation or policy that must survive renaming, use the SID reported for
the group. In authd's registry policy, use a local group's literal SID; local
group names are not resolved there.

## Change or remove a group

Rename a group with `lps group rename developers engineers`. Its SID and
members remain. A description can be changed separately with `lps group
describe`.

To retire a group, first remove its memberships and replace any account's
primary-group assignment. `lps group delete` refuses a group that still has
members or is used as a primary group.

Before deletion, also review resources whose access rules name the SID.
Deleting the group does not rewrite those rules. Recreating its name allocates
a different SID and does not restore its access.

Read `lps(1)` for the full command syntax.

---

# Retiring an Account

_Peios / Using Peios / Local Accounts_

> Stop further sign-ins, handle active sessions, and decide whether to delete an account.

Retire an account by stopping further sign-ins before deciding whether to
delete its identity. Keeping the account preserves the security identifier
(SID) used by its files and other access rules.

## Before you start

Prepare access and active work:

- Use an administrator session other than the account being retired.
- Keep another verified administrator route available.
- Save work in sessions that must end. Ending a session can stop
  applications before they save their work.

## Stop further sign-ins

Follow these steps:

1. Inspect the account with `lps show alice` and record its SID and groups.
2. Stop it from signing in:

   ```sh
   lps disable alice
   ```

3. Inspect `lps show alice` again to confirm the saved state.
4. If active access must stop, use a session-management client to end its
   existing sessions. Account state changes do not revoke issued tokens.

To restore the account later, use `lps enable alice`, inspect its policy, and
verify a fresh sign-in.

## The last-administrator guard

`lpsd` refuses several changes to the last account it counts as an active
administrator. These include deletion, stopping sign-in, removing its
administrator membership, and leaving it no permitted credential material.

The guard counts accounts that are turned on and hold administrator
membership. It does not prove that another administrator has usable
credentials, permitted logon types, or a reachable sign-in route. It also does
not validate the whole machine's registry policy. Verify an alternate route
yourself.

## Delete only after reviewing ownership

If the identity must be removed permanently, review files and access rules
that name its SID before running `lps remove alice`.

The account's identifier is never reused. Creating another `alice` does not
restore the deleted identity, its group membership, or its access. Deleting
the account also does not remove its home directory.

Read [Sessions and Account
Changes](/peios/using-peios/local-accounts/sessions-and-account-changes.md) for the limits
of ending active access.

---

# Principals Manager

_Peios / Using Peios / Local Accounts_

> Distinguish local accounts, built-in identities, and sign-in policy.

Principals Manager displays identities the machine knows and administers
local users and groups through lpsd. Built-in identities such as SYSTEM
and Administrators are defined by the system; they are not ordinary local
accounts to recreate or delete.

**Users** and **Groups** show names, identifiers, membership, and available
details. A user's page includes permitted sign-in methods, claims, and
administrative credential information where access allows it.

Local-account changes go through lpsd. The backend enforces its rules,
including retaining an enabled administrator that can sign in. The window
reports a refusal rather than bypassing that safeguard.

**Privileges** edits local sign-in policy in the registry. Those records
can set privileges, integrity, owner, and a default discretionary access
control list. A user's page previews the combined policy for a new
sign-in. Changing that policy is separate from editing the local account,
and uses the policy key's write access.

Account administration requires the enabled Administrators group in the
requester's token. Policy writes require the registry rights instead.
The interface shows read-only data when it can inspect an object but
cannot change it. Changes to sign-in policy apply to new sign-ins, not
retroactively to existing tokens.

See [Managing Local Accounts](/peios/using-peios/local-accounts/managing-local-accounts.md) and
`gxwi-principals-manager(1)`. The account authority and shared sign-in
semantics remain documented with authd and lpsd.

## Reviewing local policy

**Privileges** lists local policy records and a **Denied to everyone**
entry. A denied privilege cannot be granted by another record. A user's
policy preview combines the records for that user, their groups, and
Everyone; select the intended kind of sign-in before interpreting it.

**New record** selects a principal. **Edit** changes its privileges,
integrity, owner, or default DACL. An empty field makes no assignment for
that field. **Delete** removes the record; it does not imply a deny if
another applicable record still grants access. Default DACL text must be
valid SDDL understood by authd.

The editor warns before removing `SeChangeNotifyPrivilege` from Everyone
or Administrators because losing directory-traversal privilege can prevent
shell startup. On a machine with no policy, authd's default gives Everyone
that privilege. The editor preserves this default when it creates the
first policy, rather than silently discarding it.

Policy warnings above the list identify records authd ignores or duplicate
principal assignments. Resolve these using the shared account-policy
reference. Refresh with **F5** after another administrator changes an
account or policy record.

---

# Managing Accounts in Principals Manager

_Peios / Using Peios / Local Accounts_

> Inspect an identity before changing membership or sign-in settings.

Use Principals Manager for a local user's membership, credentials, claims,
and permitted sign-in methods. Check the identity and the effect on future
sign-ins before making a change.

## Before you start

You need the account-administration access enforced by lpsd. Preserve a
working administrative sign-in route when changing administrative
membership or credentials.

## Inspect and change an account

1. Open **Principals Manager**, choose **Users** or **Groups**, and use
   **Find** to locate the identity.
2. Select it and check its security identifier, local or built-in status,
   memberships, and sign-in configuration.
3. Choose the intended account operation and review its confirmation.
   Change only the membership, claim, credential, or sign-in setting
   required for the task.
4. Read lpsd's response. If it refuses a change that would leave no enabled
   administrator able to sign in, retain or repair another valid route
   before reconsidering the operation.

## Check the result

Refresh with **F5** and verify the stored identity and membership. Test a
new sign-in when the change concerns credentials or token policy.
Existing sessions retain their own tokens.

Use **Privileges** for registry-based local sign-in policy. Its preview
describes what a new sign-in would receive, not the rights of every
already running process. For changing only your own display name,
password, keys, or locale, use My Settings instead.

## Choosing an account action

Account actions have different effects:

| Action | Effect |
|---|---|
| Edit | Changes the full name, home path, shell, or primary group. Changing the home path does not move files. |
| Rename | Changes the name while retaining the SID and existing access grants. |
| Set password | Changes the password without ending existing sessions. |
| Sign-in | Selects accepted credentials and permitted kinds of sign-in. |
| Disable | Refuses new sign-ins while preserving the account and its SID. |
| Delete | Removes the account permanently; its old SID is not reassigned. |

Adding an SSH key does not itself enable SSH-key authentication. Check
**Sign-in** as well. Credential-free sign-in does not permit SSH access.
Explicit permission to run a service is separate from ordinary sign-in
methods. An empty claim and an absent claim have different meanings to
access conditions; inspect the intended condition before removing one.

A group rename retains its SID. A user's primary-group membership cannot
be removed until another primary group is assigned. Built-in groups with
stored membership can have members added or removed, but their system
identity cannot be renamed or deleted.

Disabling an account does not end its existing sessions. Use
[Task Manager](/peios/using-peios/processes/task-manager.md#sessions-and-visibility) to request
sign-out when required, after accounting for unsaved work. The account
store's last-administrator safeguard does not prove that a console or
network sign-in route is reachable. Test fresh access before closing your
working administrative session.

## Creating an account

To create a local user:

1. Select **Users**, then **New user**, or press **Ctrl+N**.
2. Enter the sign-in name and optional full name. Set and confirm a
   password, or explicitly select credential-free sign-in where permitted.
3. Select administrator membership only when required. Check the proposed
   home path and shell before selecting **Create**.
4. Read the result and verify the new user's SID and configuration. A
   refused creation does not leave a partially configured user.

To create a group, select **Groups**, then **New group**, and provide its
name and description. Add members after verifying the new group's SID.

---

# Changing Your Account Settings

_Peios / Using Peios / Local Accounts_

> Update your display name, credentials, and session locale.

My Settings operates on your own account. Its backend identifies you from
your token rather than accepting another account name. Use Principals
Manager for administrative changes to other accounts.

## Before you start

You need a GXWI session and permission for the selected personal setting.
Changing a password or SSH key requires your current password. A key-only
account without a password cannot use those self-service forms.

## Change a personal setting

1. Open **My Settings** and choose **Account**, **Password**, **SSH Keys**,
   or **Language & Formats**.
2. For a display name, enter the new name and select **Apply**. For a
   password, enter the current password and the new password twice.
3. For an SSH key, use **Add Key** with one public-key line and your
   password, or select **Remove** for the intended key and authenticate.
4. Read the backend's outcome. Credential fields are cleared after the
   request, including on failure.

## Check the result

Inspect the resulting name or key list. Changed credentials and locale
choices affect subsequent sign-ins; they do not replace the token of an
already running session. Keep the current session available while
verifying a new credential through the intended sign-in route.

**System Default** and **Match Language** remove the relevant personal
locale override. Locale choices are written under `CurrentUser\Locale`
and apply at the next sign-in. A restricted registry key makes the
section read-only. Account state refreshes every five seconds.
See `gxwi-my-settings(1)` for interfaces and file locations.

## Language and formats together

The form writes `LANG` and the time, number, money, measurement, and paper
format categories together. Changing **Language** can therefore replace or
remove individually configured format overrides. Use `reg` for a deliberate
single-value edit instead.

**Match Language** removes personal category values; it does not remove
machine category values. For one locale across these formats despite machine
overrides, select it in both lists. Verify a fresh session as described in
[Choosing Session Locales](/peios/using-peios/command-line-basics/session-locales.md).

---

# Changing Your Password

_Peios / Using Peios / Local Accounts_

> Change your own account password through the terminal.

Use `passwd` to change the password of the account represented by your
current process token. The account authority decides which credentials to
request and whether the new password meets its policy.

## Before you start

- Use a session for the account whose password you want to change.
- Make sure authd and that account's authority are available.
- Keep any credentials needed to verify your identity ready.

## Change the password

1. Start the conversation:

   ```sh
   passwd
   ```

2. Answer the prompts in the order shown. Terminal password input is not
   echoed. The authority can request several rounds of credentials.

3. Wait for the result before retrying. A refused change reports that the
   password is unchanged; a lost connection after submission can leave the
   outcome unknown.

The command accepts no account name. To administer another local account,
use `lps password`; see `lps(1)` for that command's requirements.

The local principal source requires an accepted current password for this
self-service change. An ordinary account without one needs an administrator
to set its password and choose the appropriate credential policy. A service
principal does not become a personal account through this operation.

A password change does not mint a replacement token or end existing sessions.
On the desktop, [My Settings](/peios/using-peios/local-accounts/my-settings.md) provides a
client for the same credential-change conversation. For the API, use
[Self-Service Operations](/peios/developing-for-peios/authentication-client/self-service.md).

## Check the result

A completed change prints `password changed`. If the outcome is unknown,
verify the account's state before attempting another change. The client
does not automatically replay a submitted request.

## Providing input through a pipe

When standard input is not a terminal, `passwd` reads one line per prompt
and does not print prompts for those lines. This requires knowing the
account authority's conversation; a different policy can request different
credentials or more rounds. Avoid putting passwords in shell history,
command arguments, or ordinary temporary files. See `passwd(1)` for the
command interface.

---

# Inspecting and Ending Sessions

_Peios / Using Peios / Local Accounts_

> Inspect visible logon sessions and request that authd end one.

Use `logonse` to inspect logon sessions and the processes associated with
them. Ending a session asks authd to sign it out; destroying an empty kernel
session is a different administrative operation.

## Before you start

- Save work in any session you intend to end.
- Use an account allowed to inspect the relevant processes. A complete
  kernel session listing needs access to the kernel's session list.
- To end a session, run authd and use an account allowed by its session-end
  policy. You can request termination of your own eligible sessions.

## Inspect a session

1. List sessions visible to you:

   ```sh
   logonse list
   ```

2. Note the numeric session ID, then inspect it. Replace `1007` with the ID
   from your listing:

   ```sh
   logonse show 1007
   ```

The process listing contains only processes whose tokens you can inspect.
It is a snapshot gathered while processes can start or exit. If the kernel
session list is inaccessible, the command reports the limitation and uses
visible processes to identify sessions. A session with no visible processes
can still be held alive by a token.

## Request a sign-out

1. Check permission without ending the selected session:

   ```sh
   logonse end 1007 --check
   ```

2. After confirming the session ID and saving its work, request sign-out:

   ```sh
   logonse end 1007
   ```

The check does not reserve permission. Authd checks the actual request
again. Service sessions end when their service stops; use `svctl stop`
for that task. The kernel's own sessions cannot be ended this way.

## Check the result

Read the reported counts and any refusal. A nonzero remaining count means
the session is still open. When ending the caller's own session, the reply
can describe planned termination before the caller exits. If the connection
is lost after submission, verify the session state before retrying.

Run `logonse list` from another session to inspect the resulting state.
Token references can keep a session alive after its visible processes exit.

## Other administrative operations

`logonse create` creates a privileged kernel authentication record; it is
not a way to authenticate a user. `logonse destroy` removes an empty
session with no remaining token references. `logonse psb` inspects or changes
process security settings, which have separate permission requirements.
See `logonse(1)` for these interfaces and the JSON output option.

## Interpret session evidence

A process or thread's token statistics contain `auth_id`, the key used to
join it to a kernel logon-session record. Looking at primary tokens answers
which session the processes run under. Looking at effective thread tokens
answers which session an impersonating request uses. These are different
counts, neither of which enumerates every open token handle.

SYSTEM session 999 and Anonymous session 998 are bootstrap records, not
unexpected interactive sign-ins. An authentication record can also exist
before a token has been attached to a process.

The kernel's `kacs.session.destroyed` event records teardown after the last
references are released. Its deferred emission can follow disappearance
from the live list. Collection gaps mean an event stream cannot establish a
complete session history by itself. Authd does not retain a complete queryable
record of the grants and policy used for every past authentication.

Token expiration metadata is not a kernel timer or an AccessCheck revocation
rule. A session-end request coordinates termination of its primary-token
processes; it does not invalidate a token handle held elsewhere. Use the
[kernel lifecycle reference](/kernel/internals/kacs/tokens/logonsessions-and-revocation.md)
for those limits. For process protection, see
[Inspecting Process Security](/peios/using-peios/identity-and-access/inspecting-process-security.md).
