social-security

Pair program with anyone over ssh, inside a throwaway sandbox, with a “social security” trust model.

Simply run sssh in a project directory, and it boots a NixOS VM with that directory mounted live, opens an ngrok tunnel, and runs an SSH front door. Guests connect with ssh, pick a username, read out a “social security number” for the owner to match out-of-band, and wait to be accepted. Accepted guests land in a shared tmux session running inside the VM. When the owner disconnects, everyone is dropped and the VM is destroyed.

Purpose

I have a NixOS dev machine that I would like others to be able to pair program on, without any setup on their part.

How it works

  guest (internet) ──ngrok──┐
                            ▼
  owner (LAN) ──────► SSH front door (wish) ──► NixOS VM ──► shared tmux
                            │                    (project mounted live)
                            ▼
                     control plane (launching terminal)
                     accept / decline / kick

For the full design see docs/DESIGN.md; requirements in docs/PRD.md; milestones in docs/PLAN.md.

Requirements

Build

go build -o bin/sssh ./cmd/sssh

A dev shell with the Go toolchain is available via nix develop. The binary embeds the sandbox flake (see embed.go), so it carries everything nix build needs to realize the VM.

Usage

In the project directory, with an ngrok token exported:

export NGROK_AUTHTOKEN=...
sssh

This boots the VM, opens the tunnel, and stays interactive as the control plane, printing two connect strings:

  1. Owner: in a second terminal, run the printed owner ssh command (over loopback/LAN). You drop straight into the shared tmux with no ceremony.
  2. Guest: share the printed guest ssh command. On connect a guest is prompted for a username and an SSN, then waits for approval.

When a guest is waiting, the control plane shows the request. Confirm the SSN with them out-of-band, then accept.

Control plane keys

KeyAction
j / kmove the cursor
aaccept the selected pending request
ddecline the selected pending request
xkick the selected active guest
qquit and end the session for everyone

Guests may only be accepted once the owner has joined the session. A kicked guest may reconnect as a fresh request.

Ending a session

Quitting the control plane (q) or the owner disconnecting the shared session tears everything down: guests are dropped, the VM is destroyed, and the tunnel is closed. Project edits are already on the host.

Git and commits

When the project is a git repo:

Non-git projects are mounted and editable with no git setup.

Configuration

VariablePurpose
NGROK_AUTHTOKENngrok authtoken (required).
SSSH_FRONTDOOR_ADDRFront door listen address (default :1337).
SSSH_HOST_KEYPath to the front door’s persistent SSH host key.
SSSH_SANDBOX_FLAKEBuild the sandbox from this flake path instead of the embedded one.

Security model

The trust model is social: the owner watches what accepted guests do and has an established relationship with them. Inside the VM there are deliberately no command or network limits, and the project directory is shared live with the host.

This is not a hardened security boundary. In particular:

Public ingress is ngrok-only; the control plane runs as a separate host-side process guests never connect to.

AI disclosure

This project was largely written by AI under the guidance of a professional software engineer. I (Miccah) wrote the PRD, and used AI to generate the DESIGN (which I reviewed), before having it generate a PLAN (which I also reviewed). Each change was also tested and reviewed before committing by me.