User management
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bryan def7a6a848 README: self-contained wording, no pointers to other documents or working notes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 11:03:34 +01:00
examples users: the machine's users and groups by name 2026-10-04 21:22:05 +02:00
lib/machine users: the machine's users and groups by name 2026-10-04 21:22:05 +02:00
scripts users: the machine's users and groups by name 2026-10-04 21:22:05 +02:00
tools users: the machine's users and groups by name 2026-10-04 21:22:05 +02:00
.gitignore users: stop tracking bin/ and build/ 2026-10-04 21:43:13 +02:00
README README: self-contained wording, no pointers to other documents or working notes 2026-10-25 11:03:34 +01:00
users users: the machine's users and groups by name 2026-10-04 21:22:05 +02:00

users: the machine's users and groups by name, and the file that holds them.

  lib/machine/users.talc (machine users): reading the file, looking a user up by
                        name or number, a group likewise
  tools/users.talc      `users [path]`: the file as a table (USERS in the
                        environment, else /etc/users)
  users                 the file the vm's image carries at /etc/users:
                        root, and nobody else yet
  examples/users.talc   the library's test
  scripts/build.sh      builds bin/users
  scripts/regress.sh    the test, then `users` on the file here

Build and check:

  scripts/build.sh
  scripts/regress.sh

which need the installed toolchain (compiler on PATH).

THE FILE. The kernel knows users and groups as numbers and nothing else,
and so does the toolchain ((system identity)); this file gives them names.
One forms file, handed to whatever reads it -- sshd (../ssh) takes it as
-users <path> -- and nothing assumes where it is:

  (group "root" 0)
  (user "root" 0 (group 0) (home "/root") (shell "/bin/shell"))
  (user "alice" 1000 (group 100) (groups 100 998) (home "/home/alice") (shell "/bin/shell"))

A user is a name, a number, its group, other groups (none unless said),
a home and a shell; a group a name and a number. There is no password
field, because nothing in this system takes a password: sshd lets a user
in on a key in <home>/.ssh/authorized_keys and nothing else. A line that
is not understood refuses the whole file, as a .service file is refused,
so that a mistake is never a user quietly missing.

What the file does not do: make home directories (the image or the
person does), hold keys, or say who may log in (anyone named, with a key
in place).

Who reads it: sshd first. ../utilities' `owner` and `list -long` print
numbers today and could print names from here; the console could one day
log a named user in. Those are not done.