Logon Sessions

A logon session records one occasion on which Peios established an identity: you signing in at the console, an SSH connection, or a service starting. Every access token belongs to exactly one logon session, and every token copied from it shares the same session. Knowing which session a program belongs to tells you how its identity was established, and lets you end everything that came from one sign-in together.

A logon session is separate from a terminal's session and from a desktop session: the word "session" names different things in each.

What a session records #

authd creates the logon session before it creates the first token for it. The session records:

  • the user's security identifier (SID);
  • the logon type, which says how the session began;
  • the time it was created;
  • an identifier that is unique while the machine is running.

The session's logon SID, in the form S-1-5-5-X-Y, comes from that identifier and is placed in the groups of every token in the session. A permission can name the logon SID to admit one session without admitting the account's other sessions. The identifier can recur after the machine restarts, so don't use it as a lasting record of an account.

A session lasts as long as any token that belongs to it.

Logon types #

The logon type describes the situation, not the account: one account can have sessions of several types at once.

Logon typeSession begins when
InteractiveSomeone signs in at the machine's console
RemoteInteractiveSomeone signs in from another computer, over SSH or to a desktop in a browser
NetworkA program on another computer authenticates to use a service here
NetworkCleartextAs Network, marked as using a credential that was sent unencrypted
NewCredentialsA program keeps its identity on this machine, marked as using other credentials for connections to other computers
BatchA scheduled job starts
ServiceA service starts

Every SSH connection is RemoteInteractive, including a single command run without a terminal. The names of the two variants describe their purpose, not what happened: NetworkCleartext doesn't prove that credentials crossed the network unencrypted, and NewCredentials doesn't make Peios forward credentials anywhere.

Sign-in policy can permit or refuse each logon type for an account; see Granting Access.

Ending a session #

Ending a logon session stops the programs whose primary token belongs to it. authd asks them to stop, then forces them. A program elsewhere that holds a copy of one of the session's tokens keeps the session alive, so ending it doesn't revoke every use of its identity. The Local System and service sessions can't be ended this way.

Inspecting and Ending Sessions describes the logonse command.

Edit this page