Skip to content

feat(register): add brev-managed sshd on port 2222#305

Open
theFong wants to merge 1 commit intomainfrom
feat/managed-sshd-port-2222
Open

feat(register): add brev-managed sshd on port 2222#305
theFong wants to merge 1 commit intomainfrom
feat/managed-sshd-port-2222

Conversation

@theFong
Copy link
Member

@theFong theFong commented Mar 4, 2026

Summary

  • Adds a hardened, brev-managed sshd instance on port 2222 that runs alongside the system sshd
  • Public key auth only, modern ciphers/KEX/MACs, isolated ed25519 host keys in /etc/brev-sshd/, systemd unit for process supervision
  • Wired into registration (Step 2, after netbird) and deregistration (non-fatal cleanup after SSH key removal)

Test plan

  • go build ./... compiles cleanly
  • go test ./pkg/cmd/register/... ./pkg/cmd/deregister/... all pass
  • Manual test on Linux VM: brev register creates /etc/brev-sshd/sshd_config, starts brev-sshd.service, ss -tlnp | grep 2222 shows listening
  • ssh -p 2222 user@localhost works with key auth, password auth rejected
  • brev deregister stops service and removes all brev-sshd artifacts

Add a hardened sshd instance managed by brev register/deregister that
runs on port 2222 alongside the system sshd. Uses public key auth only,
modern ciphers/KEX/MACs, isolated host keys in /etc/brev-sshd/, and a
systemd unit for process supervision.

- Add ManagedSSHDaemon interface + BrevSSHD provider
- Wire sshd install as Step 2 in registration flow
- Add non-fatal sshd cleanup to deregistration flow
- Add config/unit content tests and mock-based integration tests
@theFong theFong requested a review from a team as a code owner March 4, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant