Skip to content

Commit 32cf661

Browse files
committed
add docs for new host keytab
1 parent 8d17f56 commit 32cf661

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

docs/staff-docs/nix/new-hosts.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@ run the install script. disk partitioning, installs NixOS, puts our config from
138138

139139
if command does not initially succeed, nix-collect-garbage before trying to run again (something something cache).
140140

141+
## 4. Add Kerberos Keytab
142+
143+
1. Log in to the kerberos server. `ssh kerberos.ocf.berkeley.edu`
144+
2. Obtain your admin principal. `kinit $USER/admin`
145+
3. `kadmin add --random-key host/NEWHOSTNAME.ocf.berkeley.edu` to create the principal. Press enter for all options to leave them as the default.
146+
4. `kadmin ext_keytab -k NEWHOSTNAME.keytab host/NEWHOSTNAME.ocf.berkeley.edu` to export the a keytab file for the new host.
147+
5. Now, clone the `ocf/nix` repo on another machine with nix installed such as one of the OCF desktops. `git clone git@github.com:ocf/nix.git`
148+
6. Place the `NEWHOSTNAME.keytab` file in your home directory on the machine with the repo.
149+
- for moving files between hosts, try `sftp`.
150+
7. Go into the repo and enter the devshell: `cd nix && nix develop`
151+
8. `age --encrypt $(grep -h "^# public key:" secrets/master-identities/*.pub | sed 's/# public key: //' | xargs -I{} echo '-r {}') -o secrets/master-keyed/keytabs/amethyst.age ~/amethyst.keytab`
152+
- pasting the secret into the text editor opened from `agenix edit` wont work for a binary file like this
153+
9. `git add secrets/master-keyed/keytabs/amethyst.age` so nix can pick up the file
154+
10. `agenix rekey`
155+
11. add the new file under `rekeyed`, commit, and push!
156+
141157
## Resizing hosts
142158

143159
run the install script again lol

0 commit comments

Comments
 (0)