diff --git a/roles/thin-client/README.md b/roles/thin-client/README.md index b63c9fc..f89d792 100644 --- a/roles/thin-client/README.md +++ b/roles/thin-client/README.md @@ -44,32 +44,54 @@ flake entry, and committed. ### 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 # Pre-create the computer object in the ThinClients OU -adcli precreate --computer-name=AZ-TC-01\$ \ +adcli preset-computer \ --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" \ - 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) -adcli join --computer-name=AZ-TC-01\$ \ +# Produce a keytab for that pre-created computer object. +# --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 \ --host-fqdn=AZ-TC-01.az-group.local \ - --login-type=computer \ - --user=administrator --verbose \ + --os-name="NixOS" --os-version="26.05" \ + --login-user=administrator \ -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 agenix -e secrets/AZ-TC-01-krb5-keytab.age # In the editor: paste /tmp/AZ-TC-01.keytab contents, save, exit. 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 In the NetBird UI (`https://netbird.az-group.local`):