Connections and terminal on mobilePreview
How kaiport for iPhone and iPad handles your connections, SSH sign-in, host keys and jump hosts, and what its terminal does.
The screenshots of the mobile app on these pages are placeholders and will be replaced with screens of the released app.
kaiport for iPhone and iPad uses the same kind of connections as the desktop app: the ones you create in the app and the ones you import, for example from an export of the desktop app. This page describes connections, the SSH sign-in and the terminal.
Your connections
A connection on the phone has the same fields as on the desktop: name, color, tags, group, favorite and notes, plus the settings of its type. The app lists favorites first, then the connections you used most recently on this device, then the rest by name, which is the order of the desktop app. When you last used a connection is stored per device.
You can create, edit, duplicate and delete connections, mark favorites, add tags and sort connections into groups, and search them. Quick connect with user@host:port connects without saving.
Connection types
| Type | Opens | Signs in with |
|---|---|---|
| SSH | A terminal, plus files over SFTP | Password, key or keyboard-interactive prompts |
| FTP / FTPS | A file browser | User name and password, or anonymously |
| S3 | A file browser | Access key ID and secret access key |
| WebDAV | A file browser | User name and password |
| Azure Blob | A file browser | Storage account and access key |
Storage connections are described in Files on mobile.
SSH sign-in
The app tries the sign-in methods the server offers in this order: the key stored with the connection, a password, then keyboard-interactive prompts.
Password
If the connection has a stored password, the app uses it. Otherwise it asks when you connect and offers to remember the password for the connection. A remembered password is stored like the other secrets of the connection, in the iOS keychain. A wrong password is asked for again; after three failed attempts the sign-in stops.
Keys
The app reads private keys in these formats:
- OpenSSH (
-----BEGIN OPENSSH PRIVATE KEY-----) - PEM, for example
-----BEGIN RSA PRIVATE KEY----- - PuTTY (
.ppk), format versions 2 and 3
Ed25519, ECDSA and RSA keys work. For an encrypted key without a stored passphrase, the app asks for the passphrase when you connect, up to three times, and offer to remember it. PuTTY files of format version 1 aren't supported; save the key again with a current PuTTYgen.
The key itself is stored in the app, in the iOS keychain. You can import a key file from the Files app or paste the key. Imported connections don't bring their keys along: the export of the desktop app contains no keys, and a connection that only references a key file by its path, for example from ~/.ssh/config, has no key on the phone. Add the key to the connection in the app, or sign in with a password or keyboard-interactive prompts, if the server allows them.
The app can also generate a new Ed25519 key pair on the device, together with the public key line (ssh-ed25519 AAAA…) that belongs in ~/.ssh/authorized_keys on the server.
Keyboard-interactive
Some servers ask questions during the sign-in, for example for a PAM password or a one-time code for two-factor authentication. The app shows each question of the server and sends your answers back. If the connection has a stored password, the app uses it to answer a plain password prompt. If the server sends a sign-in banner, the app shows it as well.
SSH agent
The SSH agent is a desktop feature. A connection set to Agent on your computer has no key on the phone, so the app can only offer a password or keyboard-interactive sign-in for it, if the server allows them. To sign in with a key on the phone, add a key to the connection in the app. Forward SSH agent only works on the desktop.
Host keys
The app checks every server's host key on the principle of trust on first use, like OpenSSH:
- First connection: the app shows the key type and the SHA256 fingerprint and asks whether you trust the server. If you don't, the connection stops.
- Known key: the connection continues without a question.
- Changed key: the app asks again and shows the key it had stored before.
Trusted keys are stored on the phone as host or [host]:port, the way OpenSSH writes them. Each device keeps its own known hosts, so the phone asks once for each server, even if your computer already trusts it. You can review and forget stored keys in the settings. If you remove a stored key, the app asks again on the next connection.
Jump hosts
A connection can reach its server through another saved connection, like ProxyJump in OpenSSH. Jump hosts are part of kaiport Pro: without it, a connection that uses one doesn't connect, rather than going to the server directly. The app first signs in to the jump host, open a channel from there to the target server and run the target's SSH session through that channel. Both servers go through the host key check, and each one signs in with its own credentials. An import from ~/.ssh/config keeps its ProxyJump settings; the export of the desktop app doesn't contain the jump host setting, so you choose it again in the app. See SSH connections.
The terminal
The terminal of the iOS app builds on SwiftTerm, a terminal emulator for Apple platforms. Each session requests a terminal of type xterm-256color and passes LANG=en_US.UTF-8 and LC_TERMINAL with the name of the app; the server takes these variables only if its AcceptEnv setting allows them.
- Tabs: every session gets its own tab, as on the desktop. Switch, close and reopen tabs while their sessions keep running.
- Keyboard: a row above the keyboard has Esc, Ctrl, Tab, the arrow keys and function keys. With a hardware keyboard on the iPad, the desktop's shortcuts work, for example ⌘T for a new tab, ⌘W to close it, ⌘R to reconnect, ⌘J for AI Pilot and ⌘B for the files.
- Font: the bundled MesloLGS Nerd Font, so Powerline prompts render correctly.
- Color schemes: the eight built-in schemes of the desktop app, with the same colors: kaiport Dark (the default), One Dark, Dracula, Nord, Catppuccin Mocha, Solarized Dark, GitHub Light and Solarized Light.
- Startup command: the connection's startup command (Command after connecting on the desktop) runs as soon as the shell shows its first prompt, and again after a reconnect.
- Reconnect: if a session drops unexpectedly while the app is open, the app connects it again. This is a setting and on by default. A dimmed line in the terminal marks the reconnect.
- Keepalive: the app sends an SSH keepalive every 15 seconds by default, so it notices when a connection has died. You can change the interval or turn keepalives off.
Font size, cursor and scrollback are in the terminal settings.
Prompt detection
The app keeps a copy of the terminal screen in the background and uses it to tell when the shell is waiting at its prompt. It needs this to send the startup command at the right moment, and for AI Pilot, which has to know when a command has finished.
- With shell integration, the shell marks its prompt and the end of every command with escape sequences (OSC 133). Detection is exact, and AI Pilot also learns the exit code. If the shell reports its working directory as well (OSC 7), the app knows the current folder.
- Without shell integration, the app uses heuristics: the output has gone quiet, and the line with the cursor looks like a prompt. It ends in a character such as
$,#,%,>or❯, starts with➜, containsuser@host, ends in a Powerline separator, or matches the prompt the session showed first.
Shell integration lives in the shell configuration on the server. If you added it for the desktop app, the phone uses it too. See Shell integration.
Snippets
Snippets are recurring commands saved with a name, as on the desktop. On the phone they are part of the app settings and stay on the device.