v0.41.0 lets guests bring their own tools into a session: commands, VS Code Remote-SSH, Herdr, scp and sftp, and port forwards to the host's loopback. Each one is granted for the run or approved in your terminal. A new command prints the ssh config to reach a session by name.
Guest tools
- Commands. A guest's explicit command (
ssh SESSION CMD, VS Code Remote-SSH,herdr --remote) runs privately on your machine, with pipes or its own terminal. It waits for your approval in the host terminal, or runs without asking under--allow-exec. Plainsshstill joins the shared terminal. #709 - Login program.
--login-commandchooses what a guest's plainsshopens instead of the shared terminal. #709 - Port forwards. Forwards (
ssh -L) to literal loopback addresses (127.0.0.0/8 and ::1) wait for approval, or run without asking under--allow-forwarding=loopback.--allow-forwarding=anyallows any destination. #710 - Approvals. Approvals happen in your terminal.
~aopens the oldest request. Answery,aornfollowed by the code it shows. Requests expire after 60 seconds, and a session with no terminal attached denies them. File transfers use the same review instead of desktop dialogs. #708, #724 --full-access. It grants commands, file transfers and loopback forwards at once, and requires--authorized-useror--authorized-keys. #723upterm session ssh-config NAME. It prints a~/.ssh/configblock and the relay's known_hosts line, so ssh, scp, sftp and VS Code can reach a session by name. #725--detach. On a terminal,upterm host --detachnow asks its start question rather than requiring--accept. #723- Reporting.
session info,session currentand the detached JSON report what guests may do (execution,tcpForwarding,fileTransfer), along withsshConfig. #710, #725 - Docs. The README's new "Reach your own machine" section and the Herdr guide set up a door to your own machine. #725
Behavior changes
- Explicit commands. An explicit SSH command (
ssh -t … CMD) no longer joins the shared terminal withCMDignored. It runsCMDprivately, after approval or under--allow-exec.--acceptdoesn't allow it, so a detached--acceptsession denies it. To join the shared terminal, use plainsshorupterm join. - File transfers.
--allow-sftp(or--accept) lets file transfers run without approval when nobody is at the terminal. ~a. The~aescape is now consumed wherever approval is supported. To send a literal~a, type~~a, or change or disable the escape.- Deprecated flag.
--allow-local-tcp-forwardingis deprecated in favor of--allow-forwarding=any. It still works, and prints a notice when given on the command line. Its config key and environment variable keep working silently. - Guest environment. Guest commands no longer inherit the host pane's multiplexer variables:
TMUX,TMUX_PANE,STY,ZELLIJ,ZELLIJ_SESSION_NAME,ZELLIJ_PANE_ID,HERDR_ENV,HERDR_PANE_ID,HERDR_SESSION,HERDR_TAB_IDandHERDR_WORKSPACE_ID. - Relay answers.
upterm hostrefuses a relay answer whose session ID or SSH user contains anything but letters, digits and._+=:-. That way a relay can't plant shell syntax in the commands upterm prints for you to paste. A relay's refusal message is shown as plain text. #726
Embedding API
- Permission types. Import them from
host/consentinstead ofhost/sftp. There are no aliases. - Permission checker. Replace
Host.SFTPPermissionCheckerwithHost.PermissionChecker, which implementsCheckPermission(context.Context, consent.Operation, consent.ClientInfo, ...string) (consent.Decision, error)andClearConnection(string). A checker must honor the deadline and cancellation, and handle SFTP, exec and forwarding. - Built-in approval. Set
Host.TerminalConsent = true; it can't be combined with a checker. A nil checker without terminal consent denies anything not granted. - New fields.
Host.SFTPAutoAccept, andhost.RelayKeyCheckwithHost.RelayKeyTrusted, which report the relay key a session trusted.
Fixes
- Guest commands. A guest terminal command whose output was cut off now reports failure. Pending file-transfer and forward approvals now end with the session. #722
- Tunnels. The relay releases a guest's tunnel when the guest leaves, instead of holding it until the host disconnects. #712
- Consul. Consul lock releases and the shutdown cleanup now give each attempt its own deadline, so a stalled call no longer stops the retries. #715, #719
- Relay logs. Clients leaving in the ordinary course of things are logged as warnings, not errors. #713, #714, #716, #717, #718, #720
Self-hosted relays
- New uptermd options, all opt-in. uptermd can keep a guest's origin across relay hops, serve node-to-node hops on a separate internal listener, require PROXY v2 headers on an SSH listener, and sign hops with a dedicated key. #705, #706, #707
- Fly.
fly.example.tomlsetsGOMEMLIMITto keep Go's heap inside the machine. #712 - Helm. Helm chart 0.2.1 adds authorized-key support. #704
Changelog
- 20e9e1a: feat(host): add loopback forwarding consent and guest policy reporting (#710) (@owenthereal)
- c19f30e: feat(host): move guest file permissions to the primary host terminal (#708) (@owenthereal)
- cb1ea7c: feat(host): one grammar for guest grants, with --full-access (#723) (@owenthereal)
- 8f388a4: feat(host): run guest commands as private processes (#709) (@owenthereal)
- 19d1faa: feat(host): say what guest tools decide, and keep the host's pane out of guest commands (#724) (@owenthereal)
- 0a0f061: feat(server): preserve guest origin and separate internal listeners (#705) (@owenthereal)
- a72f557: feat(server): separate hop signing and neighbour key trust (#707) (@owenthereal)
- 6eeb773: feat(session): print a ready-to-paste ssh config, and document reaching your own machine (#725) (@owenthereal)
- 3523993: feat(uptermd): require PROXY v2 headers on an opt-in SSH listener (#706) (@owenthereal)
- a66aa95: fix(host): refuse a relay answer with characters upterm won't put in a command (#726) (@owenthereal)
- e5b9e75: fix(host): report cut guest output and end pending approvals with the session (#722) (@owenthereal)
- dea1f5a: fix(server): don't report a WebSocket that its client ended as an error (#717) (@owenthereal)
- 87bf214: fix(server): don't report a guest's unknown session as an error (#713) (@owenthereal)
- 42003e7: fix(server): give each Consul release attempt its own deadline (#715) (@owenthereal)
- ac117b5: fix(server): give shutdown's Consul cleanup calls their own attempt deadlines (#719) (@owenthereal)
- 7c0f6e1: fix(server): log a client that left mid-authentication as a warning (#720) (@owenthereal)
- 000da64: fix(server): log a handshake its client left as a warning (#718) (@owenthereal)
- 8890204: fix(server): log a request that isn't upterm's as a warning (#714) (@owenthereal)
- a3675df: fix(server): log a tunnel refused for a host that left as a warning (#716) (@owenthereal)
- 0760cd9: fix(server): release a guest's tunnel when the guest leaves (#712) (@owenthereal)
- 2b02ef6: fix: publish Helm chart 0.2.1 and retain previous releases (#704) (@owenthereal)
- 7d72df7: test: cover guest tools across relay connections (#711) (@owenthereal)
- 004e977: test: fix three racy tests and drop zenity's leftover requirements (#721) (@owenthereal)
- 0cb613a: test: wait for what two flaky tests check (#727) (@owenthereal)