On this page
SSH sessions: two boundaries in Keragi
Last updated: 2026-11-20
Keragi offers two SSH modes with different connection and execution locations. Do not mix them up:
| Entry | Where it connects / executes | What it is for |
|---|---|---|
| Direct SSH terminal (connector detail page / the “SSH terminal” entry in Connect (Contacts)) | The connector host SSHes to the LAN/private host you enter; commands run on that target | Operating individual LAN servers, full-screen programs such as vim/top, several tabs |
SSH conversation (“SSH conversation” in New conversation, provider ssh) | The conversation’s shell runs on the connector host itself (loopback), not on an SSH target; commands run with the connector host’s identity | Binding a subaccount as the terminal executor so it receives commands in msgx private chats/groups and returns output |
Both entries require approval on the connector host, and neither is a public remote-access product or a bastion replacement.
1. What it does
| Capability | Current support |
|---|---|
| Direct connection to a LAN/private-network host (Linux, or a Windows target with OpenSSH Server) | Supported (private addresses only) |
Run commands and full-screen TUIs on the direct target (e.g. vim/top) | Supported |
| Resize the terminal | Supported |
| Multiple terminal tabs (one independent direct session each) | Supported (tabs stay on this device only) |
Create an ssh conversation and bind a subaccount in its details | Supported (the shell runs on the connector host) |
| Run commands through a bound subaccount in msgx private chats/groups (direct in private, mention required in a group) | Supported (output is not retained) |
| Public SSH, SFTP, port forwarding, X11 forwarding | Out of current scope |
| Store SSH passwords or private keys in Keragi | Out of current scope |
| Replay terminal scrollback across restarts | Out of current scope |
2. Prerequisites
- The connector runs on a Linux host.
- The operator enabled the SSH provider and configured the allowed hosts/networks.
- The current account has connector execution permission.
- Direct terminal: the target must be loopback, RFC1918, CGNAT, link-local or IPv6 ULA/link-local; public addresses are rejected.
- SSH conversation: you do not enter a LAN target. Its shell is a process on the connector host itself.
Keragi does not store SSH passwords or private keys. The direct terminal uses the connector host’s existing method (key or ssh-agent); host keys are checked with the original hostname, and
~/.ssh/configProxyJump/ProxyCommand is not used.
3. Direct terminal (LAN host)
- Open the Direct SSH terminal from the connector detail page, or the “SSH terminal” entry in Connect (Contacts).
- Enter the target’s LAN address, port (default 22) and user.
- The session starts in waiting for local approval; open the approval page on the connector host and confirm. No connection to the target and no output stream is opened before approval.
- The terminal opens and you can type commands.
On the terminal page:
- Each tab is an independent session, so you can connect to several hosts at once; tabs are stored on this device and account only and do not sync elsewhere.
- Closing a tab ends that session (the connector also deletes the terminal record); denied or expired tabs can be retried.
- After a brief network drop the client reconnects and resumes from the last output it received; if the terminal already exited on the connector, it shows “Terminal ended” and you can retry or close.
- Resizing the window is forwarded to the remote terminal, so full-screen programs such as
vim/topreflow to the new size. - Terminal output is streamed back to the session and is not written as normal chat messages or included in AI context. Closing the session or the idle timeout ends the terminal; scrollback is not kept across restarts.
4. SSH conversation proxy (connector host)
State the boundary first: commands here do not run on the LAN host you would enter in the direct terminal, and they do not SSH to that host. An ssh conversation’s terminal is created by the connector with a loopback target on the connector host itself; commands run with that host’s permissions and identity. To operate a LAN host, use the direct terminal in section 3.
An SSH conversation can bind one subaccount as its terminal executor. Once bound, commands the subaccount receives in any msgx private chat or group it is in are ordinary chat messages: the connector writes them into the conversation’s local shell on the connector host, and output returns through the msgx stream to the originating conversation as an expandable terminal card. The msgx room itself no longer has a terminal menu or a terminal composer.
Prerequisite: first create an “SSH conversation” in New conversation, then bind the subaccount in the SSH conversation’s Conversation details. One SSH conversation has at most one subaccount, and a subaccount holds only one role at a time (terminal executor or AI agent). An unbound or revoked binding, and channel conversations, never run commands. Once bound: in private chat every non-blank message is executed as a command; in a group only a message that mentions the bound subaccount is a command, and text without a mention stays ordinary chat.
Usage:
- Open the SSH conversation’s Conversation details, pick one of your subaccounts and confirm the bind. The drawer shows the bound subaccount and its status, and lets you unbind at any time.
- Private chat: every non-blank message is one command line. Send
/terminalto start a shell and/exitto end it. There is no “ordinary chat” mode with a terminal-identity subaccount. - Group: every command must mention the bound subaccount; the command is the
text after the mention, e.g.
@ops /terminalor@ops df -h. Group text without a mention stays ordinary chat and is never executed. - Output appears in the originating conversation as one expandable “Terminal session” card, visible to every member. Terminal output is not retained: it exists only in the current page’s memory, and a refresh or re-entry starts the card empty.
Limitations to know:
- One message runs one command line; commands from multiple members are serialized into the same local shell;
- This is command-message mode, not a shared interactive terminal where several people type at once;
- Terminal output is not retained: it is shown live only while the conversation is open, and a refresh or re-entry starts the card empty; the command messages themselves remain ordinary chat history;
- After a session ends the card can still be expanded to read the output this page captured while mounted (a refresh, page switch or re-entry does not retain it and cannot backfill output that was never received);
- Large output collapses into a card so chat history is not inflated by terminal bytes; if a frame is missing in transit the card reports that some output is missing;
- Terminal output never enters AI context;
- Unbinding only stops msgx command execution; the SSH conversation and its local shell stay open;
- Closing the SSH conversation also ends its local shell and the subaccount listener.
5. Security and boundaries
- The direct terminal accepts only LAN/private addresses; public addresses, cloud metadata addresses and hosts outside the allowlist are rejected.
- Creating a direct terminal or an SSH conversation requires local approval and starts nothing before approval; the approval page is available on the connector host (or an allowlisted address).
- An SSH conversation’s commands run on the connector host itself, not on a LAN target; do not use it as a jump box or as the target machine’s terminal.
- Do not paste SSH passwords, private keys or sensitive commands into normal chat or AI conversations; direct-terminal credentials follow the connector host’s SSH login.
- Terminal actions run with the connector host’s permissions; confirm the impact before running high-risk commands.
- It is not a replacement for a bastion/audit system; use dedicated operations security tooling when you need strong audit, session recording or fine-grained command control.
- The connector host currently runs Linux; for a direct Windows target, install OpenSSH Server on the target (you get cmd/PowerShell). A Windows connector host is a future direction.
- SFTP, port forwarding, X11 and multi-host panels are out of scope; terminal output stays in the session stream or the in-memory card and never becomes chat history.