docs(thin-client): fix adcli commands in provisioning guide

The previous README used 'adcli precreate' (doesn't exist — the real
command is 'preset-computer') and several non-existent options
(--computer-name on preset, --login-type, administrator@AZ-GROUP as
positional). Caught by user running the commands against real adcli.

Corrected workflow:
- preset-computer takes host FQDN as positional, options are --domain,
  --domain-ou, --os-name, --os-version, --login-user
- join uses --host-fqdn to redirect from local machine to target
  computer object, -K writes only to specified path (does NOT modify
  local /etc/krb5.keytab)
- Added klist verification step for the resulting keytab
- Added prereq note that the OU must exist in AD
- Added TGT-based auth alternative
This commit is contained in:
m3ta-chiron
2026-07-29 12:38:27 +02:00
parent 0cc0b5064d
commit b33eeb71b8
+32 -10
View File
@@ -44,32 +44,54 @@ flake entry, and committed.
### Step 1 — Pre-create the AD computer account + keytab ### Step 1 — Pre-create the AD computer account + keytab
Run from a host that can reach the AD DC (e.g. `AZ-LT-NIX`): Run from a host that can reach the AD DC (e.g. `AZ-LT-NIX`). Requires
`adcli` (available on the admin workstation via `nix-shell -p adcli` if
not installed).
Prerequisite: the target OU must exist in AD. If `OU=ThinClients,...`
doesn't exist yet, create it first (or omit `--domain-ou` to use the
default `CN=Computers,...` container).
```bash ```bash
# Pre-create the computer object in the ThinClients OU # Pre-create the computer object in the ThinClients OU
adcli precreate --computer-name=AZ-TC-01\$ \ adcli preset-computer \
--domain=az-group.local \ --domain=az-group.local \
--host-fqdn=AZ-TC-01.az-group.local \
--login-type=computer \
--os-name="NixOS" --os-version="25.11" \
--domain-ou="OU=ThinClients,DC=az-group,DC=local" \ --domain-ou="OU=ThinClients,DC=az-group,DC=local" \
administrator@AZ-GROUP --os-name="NixOS" --os-version="26.05" \
--login-user=administrator \
AZ-TC-01.az-group.local
# Join offline and produce a keytab (no real join happens) # Produce a keytab for that pre-created computer object.
adcli join --computer-name=AZ-TC-01\$ \ # --host-fqdn redirects adcli from the local machine to the AZ-TC-01
# account; -K writes only to the specified path (does NOT modify the
# local machine's /etc/krb5.keytab).
adcli join \
--domain=az-group.local \ --domain=az-group.local \
--host-fqdn=AZ-TC-01.az-group.local \ --host-fqdn=AZ-TC-01.az-group.local \
--login-type=computer \ --os-name="NixOS" --os-version="26.05" \
--user=administrator --verbose \ --login-user=administrator \
-K /tmp/AZ-TC-01.keytab -K /tmp/AZ-TC-01.keytab
# Verify the keytab has expected principals
klist -k /tmp/AZ-TC-01.keytab
# Expected principals:
# AZ-TC-01$@AZ-GROUP
# host/AZ-TC-01.az-group.local@AZ-GROUP
# RestrictedKrbHost/AZ-TC-01.az-group.local@AZ-GROUP
# HOST/AZ-TC-01@AZ-GROUP
# RestrictedKrbHost/AZ-TC-01@AZ-GROUP
# Provision the agenix secret # Provision the agenix secret
agenix -e secrets/AZ-TC-01-krb5-keytab.age agenix -e secrets/AZ-TC-01-krb5-keytab.age
# In the editor: paste /tmp/AZ-TC-01.keytab contents, save, exit. # In the editor: paste /tmp/AZ-TC-01.keytab contents, save, exit.
rm /tmp/AZ-TC-01.keytab rm /tmp/AZ-TC-01.keytab
``` ```
Tip: if you already have an admin TGT (via `kinit administrator@AZ-GROUP`),
you can replace `--login-user=administrator` with
`--login-ccache=${KRB5CCNAME:-/tmp/krb5cc_$(id -u)}` to skip the password
prompt.
### Step 2 — Provision NetBird setup key ### Step 2 — Provision NetBird setup key
In the NetBird UI (`https://netbird.az-group.local`): In the NetBird UI (`https://netbird.az-group.local`):