Always-on Usage

Copy library / What got built / Grok Bot

A locked-down SSH user for the Grok Bot box over WireGuard

Subscribe

What it does
This NixOS PR adds an unprivileged grokbot user on the host forge for the author’s cloud assistant box. It accepts key login only from WireGuard address 10.8.0.4, with no password and no forwarding, is not in wheel, and can read only what an ordinary user can. A companion PR lets that peer reach only forge:22. Nothing changes until merged.
Scenarios
Watch PRs / repos
What the source covers
  • Author & original linkYes
  • What it doesYes
  • Verbatim source excerptYes
  • Screenshots / mediaNot in source
  • Steps / chaptersYes
  • Verbatim prompt / configNot in source
  • Results / numbersNot in source
  • Risk notesYes
  • Related entriesYes

— means the source doesn't say; we don't fill it in.

Verbatim source excerpt
feat(forge): add unprivileged grokbot SSH user restricted to WireGuard peer
## Purpose

Adds a dedicated, unprivileged SSH login on **forge** for Ryan's cloud assistant box. Goes with **carpenike/network-config#44**, which adds the WireGuard peer `10.8.0.4` and only lets it reach `forge:22`. This PR covers the host side: an account that can log in from that tunnel address and nowhere else.
Show full post

**Not deployed.** Nothing changes on forge until this is merged and switched.

## Change (`hosts/forge/core/users.nix`)

```nix
users.users.grokbot = {
isNormalUser = true;
description = "Cloud assistant box (SSH via WireGuard 10.8.0.4)";
group = "grokbot";
extraGroups = [ ];
shell = pkgs.bash;
hashedPassword = "!"; # locked: no password login
openssh.authorizedKeys.keys = [
''from="10.8.0.4",no-agent-forwarding,no-X11-forwarding,no-port-forwarding ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC+/aS6swwQyZhz6lpazJj2BFhequRtAyJIHvjTvJN/w grokbot-box''
];
};
users.groups.grokbot = { };
```

## Decisions for Ryan

- **Username `grokbot`.** Rename it if you like. The username, group, and key comment are only used here.
- **No privilege by default.** The user is not in `wheel`, so the default `:wheel` doas rule doesn't apply, and the `nopass` doas rule covers only `ryan`. It has no service or admin groups. Its primary group is its own `grokbot`, not the shared `users` group, so it doesn't pick up anything group-readable by `users`.
- **Extent of access.** The user can read only what an ordinary non-root user can on forge: world-readable files and its own home. Service data dirs (`media` 0750, and so on) stay closed to it.
- Option, **not added**: putting it in `systemd-journal` would let it run `journalctl` for system logs. Add `"systemd-journal"` to `extraGroups` only if you want that.

## Key restrictions

- `from="10.8.0.4"`: sshd rejects the key
carpenike · · Open original ↗

From the project README, verbatim and untranslated.

Steps / points from the source
  1. Highlights
  2. Repository Structure
  3. Architecture
  4. Operational Commands
  5. My Systems
  6. Services on Forge
  7. Observability Stack
  8. Backup Architecture

Verbatim from the source, untranslated.

Prompt

The source does not include a prompt you can copy verbatim.

How to copy
  1. Open the repo: github.com/carpenike/nix-config/pull/1354 ↗
  2. Read the README, send the repo link to your Bot and have it reproduce it
  3. Get it working small first, then add a routine
Risks and limits
  • Uses a browser or website login: the costliest kind of step, so prefer a connector where one exists
  • The author's result may not reproduce for you; the original post is the reference
Usage estimate
Estimate with the metal calculator