{"id":50721575,"url":"https://github.com/matiasinsaurralde/throwawaysh","last_synced_at":"2026-06-10T00:30:24.670Z","repository":{"id":337722236,"uuid":"1154724179","full_name":"matiasinsaurralde/throwawaysh","owner":"matiasinsaurralde","description":"Go SSH service that starts one ephemeral krun microVM per SSH session and connects the session to a shell inside that VM","archived":false,"fork":false,"pushed_at":"2026-02-10T23:43:39.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-02T17:37:08.942Z","etag":null,"topics":["libkrun","microvm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matiasinsaurralde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-10T17:53:43.000Z","updated_at":"2026-02-11T15:56:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/matiasinsaurralde/throwawaysh","commit_stats":null,"previous_names":["matiasinsaurralde/throwawaysh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matiasinsaurralde/throwawaysh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasinsaurralde%2Fthrowawaysh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasinsaurralde%2Fthrowawaysh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasinsaurralde%2Fthrowawaysh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasinsaurralde%2Fthrowawaysh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matiasinsaurralde","download_url":"https://codeload.github.com/matiasinsaurralde/throwawaysh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matiasinsaurralde%2Fthrowawaysh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34132030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libkrun","microvm"],"created_at":"2026-06-10T00:30:23.538Z","updated_at":"2026-06-10T00:30:24.665Z","avatar_url":"https://github.com/matiasinsaurralde.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# throwawaysh\n\n`throwawaysh` is a Go SSH service that starts one ephemeral `krun` microVM per SSH session and connects the session to a shell inside that VM.\n\n## What It Does\n\n- Accepts SSH connections (default `:2222`).\n- Boots a session-scoped microVM for each session.\n- Uses the VM console for non-PTY sessions.\n- Uses a guest PTY agent for interactive terminal sessions (resize/signals/stdin forwarding).\n- Keeps host-side service logs structured with `slog` (`text` or `json`).\n\n## Requirements\n\n- Go `1.25+`\n- `libkrun` installed on the host\n- A Linux rootfs directory for guest sessions (`--rootfs`)\n\n## Build\n\nUse the provided `Makefile`:\n\n```bash\nmake build\n```\n\nThis will:\n\n- Build the service binary at `./throwawaysh`\n- Build the guest agent for Linux (`arm64` by default)\n- Install the guest agent into the configured rootfs at:\n  `./rootfs/usr/local/bin/throwawaysh-guest-agent`\n\nUseful targets:\n\n```bash\nmake build-service\nmake build-agent\nmake install-agent\nmake test\nmake lint\nmake clean\n```\n\nOn macOS, `make build-service` also codesigns the service binary using `cmd/throwawaysh/entitlements.plist`.\n\n## Run\n\nMinimal run:\n\n```bash\ngo run cmd/throwawaysh/main.go --rootfs /path/to/rootfs\n```\n\nOr run the built binary:\n\n```bash\n./throwawaysh --rootfs /path/to/rootfs\n```\n\nDefault credentials (when passwordless mode is disabled):\n\n- Username: `test`\n- Password: `test`\n\n## Connect\n\n```bash\nssh -p 2222 test@localhost\n```\n\nFor passwordless mode:\n\n```bash\n./throwawaysh --rootfs /path/to/rootfs --allow-passwordless\nssh -p 2222 anyuser@localhost -o PreferredAuthentications=none -o PubkeyAuthentication=no\n```\n\n## PTY Guest Agent\n\nInteractive SSH terminal sessions (`pty-req`) rely on the guest agent binary inside the rootfs:\n\n- Expected guest path: `/usr/local/bin/throwawaysh-guest-agent`\n- If missing, PTY session startup fails with a clear error.\n\nInstall helper script:\n\n```bash\n./install_guest_agent.sh ./rootfs\n```\n\n## Configuration\n\nFlags:\n\n- `--listen-addr` (default: `:2222`)\n- `--host-key-path` (default: `server_key`)\n- `--rootfs` (required)\n- `--username` (default: `test`)\n- `--password` (default: `test`)\n- `--allow-passwordless` (default: `false`)\n- `--log-level` (default: `info`; `debug|info|warn|error`)\n- `--log-format` (default: `text`; `text|json`)\n- `--version`\n\nEnvironment variables (flag-compatible):\n\n- `SSH_ADDR`\n- `SSH_HOST_KEY_PATH`\n- `SSH_ROOTFS`\n- `SSH_USERNAME`\n- `SSH_PASSWORD`\n- `SSH_ALLOW_PASSWORDLESS`\n- `SSH_LOG_LEVEL`\n- `SSH_LOG_FORMAT`\n\n## Example Commands\n\nCustom listen/auth:\n\n```bash\n./throwawaysh --listen-addr :2222 --rootfs /path/to/rootfs --username demo --password demo\n```\n\nJSON logs:\n\n```bash\n./throwawaysh --rootfs /path/to/rootfs --log-level debug --log-format json\n```\n\n## Notes\n\n- The server creates the SSH host key file at `--host-key-path` if it does not already exist.\n- Each SSH session maps to an isolated VM lifecycle.\n- Current service is intentionally simple and focused on per-session isolation over persistence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatiasinsaurralde%2Fthrowawaysh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatiasinsaurralde%2Fthrowawaysh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatiasinsaurralde%2Fthrowawaysh/lists"}