Files
ShellBook/templates/workspace/notebooks/admin-user.md
T
Florian Schmidt bdbcd2dcd5 feat(core): parameter fields in text, groups and gating by used values (#16)
- `::param{name=x}` places a parameter's input inside the text.
- `:::group{title="…" collapsed}` is a collapsible container for anything;
  groups are presentational and never gate steps. Included notebooks
  namespace field names and group titles.
- `groupInputs` reports a container's input status (missing, filled,
  optional, none) from its fields, the parameters its steps use and, for
  `::use`, the included notebook's parameters.
- A step is gated only by the values it uses: referenced parameters, the
  required secrets its script reads and valid set secrets of its scope.
  Unused required parameters no longer block early steps of a guided
  runbook.
- Spec §3.2/§3.6/§3.7, workspace format guide and a guided admin-user
  example notebook.
2026-11-16 16:49:47 +01:00

1.8 KiB

title, params
title params
Create an admin user
host user pubkey shell
type required label
host true Target server
type required label
name true User name
type required label
string true Public SSH key
type default label
path /bin/bash Login shell

Create an admin user

A guided runbook: each section asks for what it needs where it is explained. A section's outline turns green once its values are filled in. For Debian hosts; runs need passwordless sudo and ask for confirmation.

:::group{title="1. Pick the server"} Choose the machine from Hosts. This check only reads state.

::param{name=host}

true

:::

:::group{title="2. Describe the user"} Pick a login name (letters, digits, ., _, -) and paste the public key the user logs in with, e.g. the content of their ~/.ssh/id_ed25519.pub.

::param{name=user}

::param{name=pubkey}

::param{name=shell}

! id {{user}}

:::

:::group{title="3. Create the user"} Creates {{user}} in the sudo group and authorizes the key.

useradd --create-home --shell {{shell}} --groups sudo {{user}}
install -d -m 700 -o {{user}} -g {{user}} /home/{{user}}/.ssh
printf '%s\n' {{pubkey}} > /home/{{user}}/.ssh/authorized_keys
chown {{user}}:{{user}} /home/{{user}}/.ssh/authorized_keys
chmod 600 /home/{{user}}/.ssh/authorized_keys

:::

:::group{title="4. Verify" collapsed}

id -nG {{user}} | grep -qw sudo
test -s /home/{{user}}/.ssh/authorized_keys

:::