Skip to content

Browser terminal

When a preview includes SSH servers, viewers can open a terminal on them in the browser, with nothing to install. This page is written so you can send it to them. Sharers set the servers up in TCP and SSH.

There are two pages:

Page Address Shows
The terminal https://<terminal address>/__hg/ssh?target=<server>:22 One server
The terminals page https://<terminal address>/__hg/terminals Every SSH server of the preview, up to 8 sessions side by side

The terminal runs on an address of its own, where no app runs, so nothing on the app’s pages can open a terminal in your name. For a preview of a web app with SSH servers, that is the preview’s terminal address, <preview name>-term.<workspace>.houseguest.page; for a preview made of SSH servers alone, its own address. A terminal link on the app’s address takes you there; the address bar then shows the terminal address.

Both need you signed in to the preview. If you are not, the preview’s own sign-in comes first (the invite link or your work email, as for the app), and then the terminal opens.

Both pages have Sign out at the right of their header. It signs this browser out of the whole preview: the terminal address, every hostname of the app and every open terminal, which closes within a few seconds. The page then reads Signed out of the preview. Signing out on the app’s address (https://<preview address>/__hg/signout) signs the terminal address out too.

The person who shared the preview chooses, per server, how its terminal signs in:

You see Enter
Password and Private key The username, and the server’s password or a private key you hold for it
Houseguest certificate only The username alone (filled in when only one is allowed). Houseguest signs you in, in your own name: see Houseguest certificates
All three Either of the above

A private key is pasted, or on the terminals page also chosen or dropped as a file. When the key has a passphrase, enter it too. Passwords, keys and passphrases go to the server for that session only: Houseguest™ does not keep them, and the page forgets them when the browser tab closes.

The terminal page shows Connect to and the server’s name. Choose how to sign in, fill in the fields and press Connect. The session opens in the page; the header shows the server, the address you signed in with and whether it is connected.

Some servers start a program instead of a shell, such as a menu or a demo. The page then shows the command above the sign-in, with Starts with (the program opens first) or Command only (the server runs that program and nothing else). On the terminals page the same appears under the server’s name; a long command is cut short, and pointing at it shows all of it.

When the program quits, the page shows either the end of the session, as when a shell exits, or Session ended with two buttons: Reconnect opens the program again (with a Houseguest certificate at once; with a password or key, after you enter them again), and Back to terminals goes to the list of servers.

The terminals page lists the preview’s SSH servers. The person who shared it sends its address, and a preview made of SSH servers alone opens on it directly.

  1. Under Shared sign-in, enter a username and a password or private key that the servers have in common. For a key, the page shows its type and SHA256 fingerprint and asks for the passphrase when the key has one. The shared password or key goes to every server set to Shared sign-in.
  2. Tick the servers to open. For each, Sign in with is Shared sign-in, Its own password, Its own key or, where allowed, Houseguest certificate; anything other than the shared sign-in adds fields to that row.
  3. Press Open 3 tabs (the number follows the servers ticked). Each server opens in its own session.

When every server takes Houseguest certificates only, there is no shared sign-in: tick the servers and open them.

The Host key column shows each server’s remembered fingerprint, or First connection: remembered after sign-in for a server not seen before.

Beside a server’s name, In use means someone is connected to it right now: in a browser terminal or with ssh through the houseguest command line, on any of the preview’s edges. Connected means the only session on it is this browser’s own. Neither says who, or how many. The page checks every 10 seconds, so with one server per person (a training room, a row of lab machines) everyone can pick one nobody else is on. The Servers layout shows In use beside an open session when someone else is on the same server.

Other viewers of the preview see the same marks: a session of yours shows as In use to them, without your name. In use is an indicator, not a lock: anyone can still connect to that server. It can also miss a session while an edge is out of service or not reachable.

Choose a layout in the header. The browser remembers it.

Layout Shows
Tabs (default) One server at a time, a tab per server. Ctrl+Shift+1 to 8 switch servers
Grid Every session in tiles. Typing goes to the highlighted tile only. Maximize (or a double-click on its title) shows one tile; Back to grid returns
Servers A list of servers beside one or two sessions. Click shows a server on the left, shift-click on the right; Split and Single switch between two panes and one

The header also shows how many sessions are connected and when the preview ends. + Open server returns to the list to open more, the × on a session (Disconnect) ends that one, and Disconnect all ends every session.

If a server refuses the sign-in, its tab or tile shows that server’s sign-in form with the message, to correct and Connect again, or Close. The other sessions carry on.

The terminal remembers each server’s host key the first time anyone in the preview’s workspace signs in to it, and checks it on every later connection. If the key changes, the terminal stops before signing in and shows The server’s host key has changed. with the old and the new fingerprint. On the terminals page this happens in that server’s tab or tile only.

Check the new fingerprint with the server’s owner. A server that was rebuilt gets a new key; an unexpected change can mean someone is intercepting the connection. Only then press I checked it: trust the new key. The new key then applies to you alone. It applies to every viewer of that server when a member of the workspace with Add TCP services across the workspace trusts it, signed in to the preview with a sign-in that proved their address: an email code, single sign-on, or Google or Microsoft, not an invite link alone.

  • One person has at most 8 browser terminals open at once on a preview, across pages and browser tabs. A ninth is refused with Refused: 8 sessions are open already. Close one to open another.
  • A session closes after 30 minutes without activity.
  • A session closes within 15 seconds of your access ending: when the preview ends, when you are revoked or when the server is removed from the preview.
  • The browser terminal is SSH only. For a database or another service, use the command line.

The browser terminal runs the SSH session on Houseguest’s edge, which sees it in the clear, as it sees web previews. The command line keeps SSH encrypted end to end: see the Security model.

Message What to do
Enter a username. / Enter a password or a private key. Fill in the missing field
This key needs its passphrase. Enter the key’s passphrase
That private key could not be read. Paste the whole private key, from -----BEGIN to -----END, or choose the key file. Not the .pub file
The server refused that username and password or key. Check them with the server’s owner
The server is not reachable right now. The server is down, or the agent in front of it is. Try again later, or tell the person who shared it
This server accepts Houseguest certificates only. Choose Houseguest certificate
This server does not accept Houseguest certificates. Sign in with a password or key, or ask the sharer to allow certificates
That username is not allowed for this server. Use one of the usernames the sharer allowed
The server refused the Houseguest certificate for that username. The server does not trust the workspace’s certificate authority yet, or has no such account. Tell the person who shared it: see Houseguest certificates
That service is not part of this preview. The server was removed from the preview, or the address is wrong
This preview has no SSH servers. The terminals page has nothing to show: the preview has no SSH service (any more)
Closed after 30 minutes without activity. Open the session again
Closed: access to this preview ended. The preview ended, or your access did