Skip to content

Upterm 0.37.0

Latest

Choose a tag to compare

@owenthereal owenthereal released this 10 Oct 18:41
· 8 commits to master since this release
v0.37.0
4d2a287

New guide: Reach your Herdr agents from anywhere. Leave agents running in Herdr on a machine at home, and reach them from a phone or another laptop with upterm as the door. The forced-command, terminal-reset, open-session and jump changes below serve it.

Behaviour changes

  • A guest's forced command (--force-command) is hung up when its guest leaves or the session ends, rather than killed at once: SIGHUP, then its terminal is closed, then SIGTERM, then SIGKILL, a second apart (about 4 s at worst). A session that ends waits up to about 7 s for its forced commands. On Windows the command is still killed at once.
  • A forced command keeps running when its guest's input ends, with or without --read-only. ssh -tt with a closed or piped stdin now gets the command's whole output and its exit status, where it used to get little or nothing.
  • Guests are sent a terminal reset when the session or their forced command ends. upterm attach also resets kitty's keyboard protocol and modifyOtherKeys on detach and on ~^Z, and a guest or upterm attach joining a session has those modes replayed to it.
  • A session started with --accept and no --authorized-keys or --authorized-user is open: anyone with the session ID can join. upterm host warns about it on stderr, session info and the banner show Access: open: anyone with the session ID can join, and session info -o json and upterm host --detach -o json carry "open": true.
  • A guest connection's forwards (a jump, ssh -J or -L) are listed as jump … → host:port in session info and its notifications, apart from the guest's terminal or SFTP entry, and the leave notification names every destination. Destinations are hidden under --hide-client-ip and in CI. guestCount still counts these entries, and an older CLI shows them as guest.
  • A guest turned away by another relay node is told why: its session channel is rejected with upstream has no session, upstream can't look up sessions or upstream refused the key, where it used to get ssh: unable to authenticate with the upstream for all three. A self-hosted relay needs every node on 0.37.0 for this: an older node reports the old text, or passes the new one on unchanged.
  • upterm session current exits 4 outside a session ($UPTERM_ADMIN_SOCKET unset, or nothing answers at it): silently with -o, as a shell prompt calls it, and otherwise with one line. It used to print its usage and exit 1. The README's prompt recipes check $UPTERM_ADMIN_SOCKET first.

New

  • A guest's forced command gets sshd-style SSH_CONNECTION, SSH_CLIENT and SSH_TTY for that guest's connection, and no longer inherits the host's own. --hide-client-ip, and CI, leave out SSH_CONNECTION and SSH_CLIENT. Behind a relay older than 0.37.0 the command gets only SSH_TTY, and on Windows it gets no SSH_TTY.

Fixes

  • upterm host reads known_hosts on every host-key check. On an SSH rekey it no longer re-prompts mid-session or, under --skip-host-key-check, appends the key again. A relay first trusted in that run, dialled by an address its certificate doesn't name, is refused at the rekey rather than at the next redial. Adding a key no longer glues it onto a last line that has no newline.
  • A guest carried by one relay node to another that turns it away now always gets the reason; some such joins used to end with ssh: unexpected packet in response to channel open: <nil>.

Compatibility

  • Old and new hosts, relays, CLIs and daemons mix. AuthRequest gains local_addr, and the admin API gains GetSessionResponse.open, the client kind FORWARD, Client.forward_destinations and Client.unlisted_forwards, all optional.

uptermd.upterm.dev already runs 0.37.0.

Changelog

  • eb77e38: feat(host): tell a guest's forced command it is that guest's SSH session (#620) (@owenthereal)
  • f3c9966: feat(server): say why another relay node turned a guest away, and split attach and the relay-key check for upterm join (#628) (@owenthereal)
  • 631a1d5: feat: show a jump through the session as one, and where it goes (#625) (@owenthereal)
  • 27ef4d7: feat: warn when a session is open, and say so in session info (#624) (@owenthereal)
  • 3eefed6: fix(cli): exit 4 quietly from 'session current' outside a session, and check $UPTERM_ADMIN_SOCKET in the prompt recipes (#619) (@owenthereal)
  • 047e835: fix(host): hang up a guest's forced command rather than kill it, and put guests' terminals back when it or the session ends (#621) (@owenthereal)
  • 39e819c: fix(host): keep a forced command running when its guest's input ends (#622) (@owenthereal)
  • 4d2a287: fix(server): pass on a rejection from a relay node that disconnects at once (#629) (@owenthereal)