mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
backend.SSHTarget has Key, the one private key file that logs in (Lima: its ssh config's first IdentityFile), and Options no longer carry IdentityFile. vmssh.FromTarget is the one check of a target: a user and an absolute key that can't break an ssh config line, on a port of the host's loopback (vmssh.Loopback, 127.0.0.1) and nowhere else. Links' linkSSH uses it in place of its own IdentityFile parsing and checks. The ssh config uses it too, which adds the loopback check it lacked: a VM whose backend names another address, a name, no user or no key gets no entry, so an editor's ssh (and a forwarded agent) never goes elsewhere. Entries write Hostname, User and IdentityFile from the checked target. Tests: TestFromTarget (vmssh); TestWriteNoAddress gains other addresses, a name, 0.0.0.0, no user and no key (failed before on the addresses); TestSSH (lima) checks Key is the first IdentityFile alone; the conformance reach check needs a user and a key. Docs: using/ssh.md says entries reach the VM on 127.0.0.1 alone; internals/design.md says links take a VM's ssh only there, and names internal/vmssh's path. Co-Authored-By: Claude Opus 5.5 <[email protected]>