vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Add vole ssh-config and finish the macOS sshd front door
014569126b8ffc3e78242d32228e3e8ea9014db3 · Keenan Nemetz · 3d ago · parent 75478a9d
Add vole ssh-config and finish the macOS sshd front door Add the ssh-config command that renders the sshd drop-in with the real binary, config, and socket paths, defaulting to the host platform and accepting overrides. Regenerate the CLI reference. Rewrite the macOS front-door procedure in the deploy guide end to end: render with ssh-config, enable Remote Login, install the ssh-shell wrapper, create the forced-command account with sysadminctl, and decide the socket directory's group (one shared group with setgid, so the 0660 socket is reachable by both the service account and git).
docs/deploy/index.md +55−24
| @@ -262,40 +262,71 @@ git clone ssh://git@forge.example.com/demo.git | |||
| 262 | 262 | ||
| 263 | 263 | A full macOS deployment — service variants, paths, the service account, and the | |
| 264 | 264 | launchd caveats — lives on [Deploy Vole on macOS](macos.md). This section is only | |
| 265 | the sshd front door. The `Match` block is the same; everything around it is not. The release attaches | ||
| 266 | the macOS drop-in as `vole-darwin-sshd.conf`, and the header names the macOS | ||
| 267 | steps: | ||
| 265 | the sshd front door. The `Match` block is the same; everything around it is not. | ||
| 266 | The release still attaches `vole-darwin-sshd.conf`, but `vole ssh-config` renders | ||
| 267 | the drop-in with the real binary and config paths, which is what a Homebrew | ||
| 268 | install needs: | ||
| 268 | 269 | ||
| 269 | 270 | ```sh | |
| 270 | curl -fsSLO https://rodent.software/vole/channels/stable/vole-darwin-sshd.conf | ||
| 271 | sudo install -m 0644 vole-darwin-sshd.conf /etc/ssh/vole.conf | ||
| 271 | vole ssh-config --platform darwin > /etc/ssh/vole.conf | ||
| 272 | 272 | ``` | |
| 273 | 273 | ||
| 274 | 1. Append `Include /etc/ssh/vole.conf` at the end of `/etc/ssh/sshd_config`. | ||
| 274 | Render it before you install it. The header it prints carries the macOS steps; | ||
| 275 | the `--vole`, `--config`, and `--socket` flags replace the defaults it names. | ||
| 275 | 276 | ||
| 276 | 2. Check and reload sshd, with Remote Login on: | ||
| 277 | 1. Enable Remote Login and append one line at the **end** of `/etc/ssh/sshd_config`: | ||
| 277 | 278 | ||
| 278 | 279 | ```sh | |
| 279 | sudo sshd -t && sudo launchctl kickstart -k system/com.openssh.sshd | ||
| 280 | 280 | sudo systemsetup -setremotelogin on | |
| 281 | echo 'Include /etc/ssh/vole.conf' | sudo tee -a /etc/ssh/sshd_config | ||
| 281 | 282 | ``` | |
| 282 | 283 | ||
| 283 | 3. Create the forced-command account with `sysadminctl`, giving it the shell the | ||
| 284 | drop-in names, and set the three settings in `vole.toml`. `ssh_socket` must | ||
| 285 | name a directory both the service account and that account can reach: there is | ||
| 286 | no `/run` and no tmpfiles on macOS. `vole serve` creates the directory if it is | ||
| 287 | missing, but not the group they share. The service account and the group it | ||
| 288 | shares with that account are covered in | ||
| 289 | [Deploy Vole on macOS](macos.md#run-as-a-launchdaemon). | ||
| 290 | |||
| 291 | 4. Restart Vole the way you started it. | ||
| 292 | |||
| 293 | The drop-in names `/usr/local/bin/vole`, `/usr/local/etc/vole/vole.toml`, and | ||
| 294 | `/usr/local/lib/vole/ssh-shell`, the paths of a system install. A Homebrew | ||
| 295 | install uses the prefix `brew --prefix` prints (`/opt/homebrew` on Apple | ||
| 296 | Silicon), so change those paths to match. `AuthorizedKeysCommandUser` is the | ||
| 297 | account `vole serve` runs as. Start the service with the LaunchAgent or | ||
| 298 | LaunchDaemon in [Deploy Vole on macOS](macos.md). | ||
| 284 | 2. Check and reload sshd: | ||
| 285 | |||
| 286 | ```sh | ||
| 287 | sudo sshd -t && sudo launchctl kickstart -k system/com.openssh.sshd | ||
| 288 | ``` | ||
| 289 | |||
| 290 | 3. Install the shell wrapper and create the forced-command account. The account's | ||
| 291 | login shell has to exec exactly one thing, so a three-line wrapper hands off to | ||
| 292 | `vole ssh-shell`. Put it where the drop-in names it, pointing at your prefix | ||
| 293 | (`/usr/local` for a system install, `/opt/homebrew` for Homebrew on Apple | ||
| 294 | Silicon): | ||
| 295 | |||
| 296 | ```sh | ||
| 297 | sudo mkdir -p /usr/local/lib/vole | ||
| 298 | printf '#!/bin/sh\nexec /usr/local/bin/vole ssh-shell "$@"\n' | sudo tee /usr/local/lib/vole/ssh-shell | ||
| 299 | sudo chmod 0755 /usr/local/lib/vole/ssh-shell | ||
| 300 | sudo sysadminctl -addUser git -fullName "Vole git" -shell /usr/local/lib/vole/ssh-shell | ||
| 301 | ``` | ||
| 302 | |||
| 303 | Then set the three settings in `vole.toml` and put `ssh_socket` where both | ||
| 304 | accounts can reach it. | ||
| 305 | |||
| 306 | 4. Decide the socket directory's group. macOS has no `/run` or tmpfiles, so the | ||
| 307 | operator creates the shared directory. Use one shared group: create it, put | ||
| 308 | the service account (`_vole`) and `git` in it, and make the directory | ||
| 309 | `_vole:git` with setgid so the socket inherits the group: | ||
| 310 | |||
| 311 | ```sh | ||
| 312 | sudo dseditgroup -o create -r "Vole front door" vole | ||
| 313 | sudo dseditgroup -o edit -a _vole -t user vole | ||
| 314 | sudo dseditgroup -o edit -a git -t user vole | ||
| 315 | sudo mkdir -p /usr/local/var/vole | ||
| 316 | sudo chown _vole:git /usr/local/var/vole | ||
| 317 | sudo chmod 2770 /usr/local/var/vole | ||
| 318 | ``` | ||
| 319 | |||
| 320 | `ssh_socket` then names `/usr/local/var/vole/ssh.sock`, and the socket's `0660` | ||
| 321 | is reachable by both because setgid carries the shared group onto it. A single | ||
| 322 | shared group is the simple answer; a `vole`/`git` pair adds nothing here | ||
| 323 | because only these two accounts ever touch the socket. | ||
| 324 | |||
| 325 | 5. Restart Vole the way you started it. | ||
| 326 | |||
| 327 | `AuthorizedKeysCommandUser` is the account `vole serve` runs as. Start the | ||
| 328 | service with the LaunchAgent or LaunchDaemon in | ||
| 329 | [Deploy Vole on macOS](macos.md). | ||
| 299 | 330 | ||
| 300 | 331 | `vole whoami` returning your account name means sshd resolved your key to it and | |
| 301 | 332 | the forced command reached the service. | |