New users cannot SSH into appliance — no key provisioning path
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 603
- Avg merge
- 23h 32m
- Merged PRs (30d)
- 59
Description
Problem
New appliance users have no way to SSH into the seed. The image ships with an empty authorized_keys for the genesis user, no password is set, and there is no API endpoint to add an SSH public key.
The only access path is USB HTTP (http://169.254.42.1/guide) and the REST API over USB — but SSH is completely locked out for fresh devices.
Current state
create-release-image.shsanitizesauthorized_keysduring image build (line 184)auto-first-boot.sh/first-boot.shdo not provision any SSH keys- STATUS.txt tells users
ssh genesis@169.254.42.1but it won't work without a key - No API endpoint exists to add SSH keys
Proposed fix
Add POST /api/v1/ssh/authorize endpoint:
- USB-only — reject requests from WiFi/non-link-local IPs (same trust model as
pair/window) - Accepts
{"public_key": "ssh-ed25519 AAAA..."}in body - Appends to
/home/genesis/.ssh/authorized_keys(via helper script outside sandbox) - Validates key format before writing (must start with
ssh-ed25519,ssh-rsa,ecdsa-sha2-*) - Deduplicates — won't add a key that's already present
- Add a "Setup SSH" section to the guide UI with paste field + button
Files to change
src/cognitum-agent/src/api.rs— new endpoint + guide UI sectionscripts/cognitum/ssh-authorize.sh— helper script (runs outside mount namespace, like wifi-connect.sh)scripts/cognitum/ssh-authorize.service— systemd oneshot unit
Security considerations
- USB-only: link-local trust model (ADR-057) — physical access implies authorization
- Key format validation prevents injection
- No private key exposure — only accepts public keys
- Idempotent — duplicate keys ignored
Test plan
- POST valid ed25519 key over USB → key appears in authorized_keys, SSH works
- POST duplicate key → no duplicate written, 200 OK
- POST from WiFi IP → 403 rejected
- POST invalid key format → 400 error
- POST over USB after key added → SSH login succeeds
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/cognitum-agent/src/api.rs by reading the existing pair/window trust checks, then inspect scripts/cognitum/wifi-connect.sh for the helper and service pattern. Implement the endpoint, guide section, helper, and systemd unit described in the issue. Done means the listed USB, WiFi, validation, deduplication, and SSH-login cases pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, shell
- Domain
- api, devops, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100