Add SSH public key sharing workflow

This commit is contained in:
krustophski 2026-05-24 19:21:23 +03:00
parent 5d7e75bff3
commit 736f7e4695
9 changed files with 135 additions and 3 deletions

View file

@ -225,3 +225,12 @@ Never store:
- full personal documents.
Use placeholders such as `<REDACTED_TOKEN>` when documenting commands that normally include secrets.
Allowed credential-adjacent material:
- SSH public keys (`*.pub`);
- public key fingerprints;
- host/user/port/path instructions;
- verification results that do not reveal secrets.
Prefer public-key SSH access over password reuse. Store public keys in `locations/ssh-public-keys/` when useful, but keep private keys and passphrases only on the local machine or in the operating system's secure credential store.

View file

@ -0,0 +1,26 @@
# SSH Public Keys
This folder may store public SSH keys used for agent/computer access.
Allowed:
- `*.pub` public keys;
- public key fingerprints;
- notes about which user/host a public key belongs to.
Forbidden:
- private keys;
- passwords;
- key passphrases;
- credential helper files;
- tokens.
Suggested filenames:
- `pump.pub`
- `wuu.pub`
- `qore.pub`
- `airM1.pub`
When a public key is added here, also update the relevant `locations/<host>.md` file with the fingerprint and where the public key was installed.

View file

@ -1,5 +1,13 @@
# Garage Agent Log
## 2026-05-24 - SSH Public Key Sharing Rule
- Machine: current Codex Mac.
- Agent: Codex.
- Summary: User accepted the safer approach for simplifying SSH: the knowledge base may carry SSH public keys and fingerprints, but not passwords, private keys, or passphrases. Added a reusable SSH public-key workflow and public-key folder.
- Files changed: Added `skills/ssh-public-key-access.md` and `locations/ssh-public-keys/README.md`; updated global instructions, garage orchestration/status/prompts, and Windows remote-access baseline.
- Next handoff: Each garage computer should publish or document its public key, then install peer public keys in authorized-key locations on Windows machines and `192.168.1.66`.
## 2026-05-24 - pump LAN-Only Connectivity Check
- Machine: `pump`.

View file

@ -53,7 +53,8 @@ https://github.com/krustophski/agent-knowledge-base
Правила безопасности:
- Не записывай в Git и не печатай в чат пароли, VNC passwords, SSH private keys, GitHub tokens, cookies, RustDesk/AnyDesk credentials, camera credentials или Windows share credentials.
- Если пароль нужен для проверки, попроси пользователя ввести его интерактивно или используй уже сохранённый локально секрет. В отчёте пиши только "verified", "missing", "unknown" или "needs user input".
- Общий пароль для SSH/VNC может быть известен пользователю вне Git. Не вставляй его в файлы, команды, логи, markdown, shell history или финальный ответ. Если нужно сохранить доступ, предпочитай установить SSH public key или использовать локальное защищённое хранилище ОС.
- Общий пароль для SSH/VNC может быть известен пользователю вне Git. Не вставляй его в файлы, команды, логи, markdown, shell history или финальный ответ. Для постоянного доступа используй SSH public key или локальное защищённое хранилище ОС.
- Через репозиторий знаний разрешено передавать только SSH public keys (`*.pub`) и fingerprints. SSH private keys, passphrases и пароли запрещены.
- Не делай destructive-команд: не удаляй репозитории, не делай reset --hard, не force-push без явного отдельного разрешения пользователя.
- Все найденные факты, проблемы и решения сохрани в agent-knowledge-base и запушь.
@ -101,6 +102,7 @@ https://github.com/krustophski/agent-knowledge-base
- после любого исправления повтори проверку порта и login.
7. Если OpenSSH Server отсутствует, установи его elevated через Windows Capability, включи firewall TCP 22 и повтори проверку.
8. Для устойчивого доступа между компьютерами создай или найди локальный SSH public key и установи его на целевые машины/сервер только как public key. Private key не копируй в Git и не печатай.
9. Если нужно передать ключ через knowledge base, добавь только `.pub` файл в `locations/ssh-public-keys/<hostname>.pub` и fingerprint в `locations/<hostname>.md`.
Проверь VNC:
1. Проверь локальный VNC server:

View file

@ -129,6 +129,8 @@ Use hostname-based users and Git identities:
The shared temporary SSH/VNC password was provided out-of-band by the user for setup convenience. Do not commit the password value. Prefer SSH keys for ongoing access.
SSH key rule: agents may exchange and commit only public SSH keys and fingerprints. Use `locations/ssh-public-keys/` for public keys when useful. Private keys, passphrases, and passwords must stay outside the repository. See `skills/ssh-public-key-access.md`.
## Initial Tasks
- On `wuu`, rerun the Windows baseline setup from an interactive elevated PowerShell. The non-elevated Codex session could request UAC but could not confirm completion.
@ -147,6 +149,7 @@ The shared temporary SSH/VNC password was provided out-of-band by the user for s
- Run `qore` SSH key setup from an elevated local shell or recreate `garage-agent-runner-qore` with highest privileges; non-elevated `setup-remote-access-v2` already reported `Elevated: False`, and non-elevated scheduled-task refresh returned access denied.
- Verify full TightVNC login to `wuu` from another computer; install/configure OpenSSH Server and persistent scheduled runner there from an elevated shell if live shell control or autonomous polling is required.
- Set or verify VNC passwords with `tvnserver.exe -configservice` interactively on each Windows machine; never store them in Git.
- Replace repeated SSH password entry with public-key access: each machine should publish only its `.pub` key/fingerprint, and target machines should install that public key in `authorized_keys`.
- After `wuu` baseline is installed, verify `pump:22` and `pump:5900` from `wuu`.
- After remote access is stable, continue physical-runtime inventory on `pump`: projectors, cameras, MOZA devices, pedals, gearbox, and plow joystick.
- Create heartbeat files for all three machines; `pump` and `wuu` now have heartbeats, `qore` still needs one from a local inventory.

View file

@ -59,6 +59,7 @@ Build and finish the garage auto-simulator setup by consolidating scattered proj
- LAN-only recheck from `pump` at 2026-05-24 19:15 MSK: `wuu` LAN `192.168.1.192` has SSH TCP `22` open but BatchMode login fails for `wuu`/`post`; `qore` LAN `192.168.1.126` SSH TCP `22` times out. Both `wuu` and `qore` return TightVNC `RFB 003.008 VNCAuth,Tight` on TCP `5900`; full VNC login still needs the user-held password.
- LAN-only local Git server recheck from `pump` at 2026-05-24 19:15 MSK: `pump@192.168.1.66` SSH login works; `git ls-remote` works for `StereoWallND.git` and `Kamaz_Cleaner.git`; `git push --dry-run` to `Kamaz_Cleaner.git` `HEAD:refs/heads/connectivity-test/pump` succeeds without creating a real branch.
- The shared SSH/VNC password is user-held outside Git. Agents may use it interactively or configure server-side/local OS credential/key access, but must not store the password value in this repository.
- SSH access should be simplified through public-key exchange. Public keys and fingerprints may be stored in `locations/ssh-public-keys/`; private keys, passphrases, and passwords must remain outside Git.
- `/srv/git/Kamaz_Cleaner.git` now has a safe branch `telemetry-only-main` at `810063520`, pushed from `qore`, containing only isolated telemetry changes.
- `/srv/git/Kamaz_Cleaner.git` `main` still points at `465385495`, a risky commit with a telemetry message that deletes almost the entire previous snapshot; do not treat it as a safe telemetry-only baseline until reconciled.
- `qore` has GitHub SSH access to `agent-knowledge-base`; `agent-bus/heartbeats/qore.md` and a Windows `garage-agent-runner` script were added.
@ -124,6 +125,7 @@ The first useful version should probably be a small playable prototype:
- Keep `garage-agent-runner-pump` installed through the fixed scheduled-task installer; if recreated manually, use the UNC-safe installer and `-Once` runner mode.
- Use the OpenSSH/TightVNC baseline on Windows machines; TigerVNC is only the viewer unless explicitly requested.
- Use `tvnserver.exe -configservice` on `qore`, `wuu`, and `pump` to set or verify VNC passwords interactively; never store or print VNC passwords.
- Add or verify SSH public keys for `pump`, `wuu`, and `qore` on each target machine and on `192.168.1.66` so normal checks no longer require password prompts.
- From `wuu`, re-test `pump` TCP `22` and `5900`, especially `192.168.1.39:22` and `192.168.1.39:5900`.
- After remote access is stable, continue `pump` physical setup: projectors/display topology, camera/webcam verification, and exact MOZA/pedal/gearbox/plow input map.
- Decide which projects should be merged, preserved, archived, or rewritten.

View file

@ -12,3 +12,4 @@
- `dialog-summary-import.md` - how agents summarize useful context from separate dialogues into this repository.
- `remote-visual-access.md` - how agents set up webcams/cameras and VNC for remote visual analysis and control.
- `multi-machine-agent-orchestration.md` - how to coordinate agents and daemon-like workers across multiple computers.
- `ssh-public-key-access.md` - how to exchange and install SSH public keys without storing private keys or passwords.

View file

@ -0,0 +1,82 @@
# SSH Public Key Access
## Purpose
Use SSH public keys to simplify agent and computer-to-computer access without storing passwords or private keys in the knowledge base.
## Rule
The knowledge base may store:
- SSH public keys (`*.pub`);
- public key fingerprints;
- hostnames, users, ports, and authorized-key install instructions;
- verification results.
The knowledge base must not store:
- SSH private keys;
- passwords;
- passphrases;
- credential helper stores;
- VNC passwords;
- tokens or cookies.
## Standard Public-Key Exchange
For each project computer:
1. Generate or locate a local SSH keypair on the computer.
2. Keep the private key on that computer only.
3. Commit only the public key to `locations/ssh-public-keys/<hostname>.pub` or record its fingerprint in `locations/<hostname>.md`.
4. Install the public key on target machines in the correct `authorized_keys` file.
5. Verify non-interactive login with `ssh -o BatchMode=yes`.
6. Update project status and agent log.
## Windows OpenSSH Notes
For normal users, use:
```powershell
$keyDir = "$env:USERPROFILE\.ssh"
New-Item -ItemType Directory -Force -Path $keyDir | Out-Null
Add-Content "$keyDir\authorized_keys" "<PUBLIC_KEY_LINE>"
```
For administrator users, Windows OpenSSH commonly uses:
```powershell
$adminKeys = "$env:ProgramData\ssh\administrators_authorized_keys"
New-Item -ItemType Directory -Force -Path (Split-Path $adminKeys) | Out-Null
Add-Content $adminKeys "<PUBLIC_KEY_LINE>"
icacls $adminKeys /inheritance:r
icacls $adminKeys /grant "SYSTEM:F" "Administrators:F"
icacls $adminKeys /remove "Users" "Authenticated Users" "Everyone"
Restart-Service sshd
```
Only public keys are copied.
## Linux Git Server Notes
For `garage`, the local Git server is `192.168.1.66:/srv/git` with users `qore`, `wuu`, `pump`, and `airM1`.
Install a machine public key like this:
```bash
user=<qore|wuu|pump|airM1>
install -d -m 700 -o "$user" -g "$user" "/home/$user/.ssh"
printf '%s\n' '<PUBLIC_KEY_LINE>' >> "/home/$user/.ssh/authorized_keys"
chown "$user:$user" "/home/$user/.ssh/authorized_keys"
chmod 600 "/home/$user/.ssh/authorized_keys"
```
## Verification
```bash
ssh -o BatchMode=yes <user>@<host> hostname
git ls-remote ssh://<user>@192.168.1.66:22/srv/git/Kamaz_Cleaner.git HEAD
git push --dry-run ssh://<user>@192.168.1.66:22/srv/git/Kamaz_Cleaner.git HEAD:refs/heads/connectivity-test/<host>
```
Do not run real push tests unless the user explicitly approves a temporary branch.

View file

@ -56,7 +56,7 @@ icacls $adminKeys /remove "Users" "Authenticated Users" "Everyone"
Restart-Service sshd
```
Do not commit private keys.
Do not commit private keys. Public keys may be documented or stored in `locations/ssh-public-keys/` when useful.
## TightVNC Server Setup
@ -117,4 +117,3 @@ sc.exe failureflag tvnserver 1
```
Verified on `pump` on 2026-05-24.