SSH commands
Let an agent run commands over SSH on a public server while Sallyport keeps the private key.
On this page
The agent sends a command. Sallyport signs in with your key or password, runs it and returns the output. The agent never sees either.
Add the host
- Open Connect an SSH host. From Credentials, it is Add a credential, then SSH host under Credential source.
- Enter a Connection name. Agents see it, and the host’s tool is named after it.
- Enter the Public hostname or IP address, the SSH port and the SSH user. The port is 22 unless you change it.
- Pick the Workspace if you have more than one, and the Environment: Live or Test.
- Under Sign in with, keep Private key and paste the OpenSSH private key. If the key has a passphrase, enter it in Key passphrase (optional).
- A server that takes no key, such as shared hosting, a router or an appliance: choose Password and enter the SSH password. Sallyport answers both the password and the keyboard-interactive prompt with it.
- Press Save SSH connection. The key is write-only, and nobody can read it back.
Sallyport checks the address when you save. A private address, or one that points at Sallyport itself, is refused.
Check the server’s identity
Host-key verification (optional) offers two choices.
| Choice | What happens |
|---|---|
| Pin the first key after successful SSH authentication | The default. Sallyport records the server’s key fingerprint at the first successful sign-in and refuses any later change. |
| Require a fingerprint I verified | Paste the SHA256: fingerprint from the server’s owner into Verified SHA-256 host fingerprint. Sallyport connects only to a server with that key. |
The connection page shows the fingerprint under Host key verification. If the server’s key changes, calls stop with host_key and no command runs.
Confirm the new key with the server’s owner first. Then open the connection’s page, press Replace pinned key under Host key verification, paste the new SHA256: fingerprint and press Pin this key. Approvals given for the old key stop counting. A script does the same with a console key (REST API). GET /v1/ssh-hosts lists your hosts with their id. PATCH /v1/ssh-hosts/{id} with known_host_key pins the new key.
export SP_CONSOLE_KEY='sp_ck_…'
curl --fail-with-body -H "Authorization: Bearer $SP_CONSOLE_KEY" \
https://mcp.sallyport.cloud/v1/ssh-hosts
curl --fail-with-body -X PATCH -H "Authorization: Bearer $SP_CONSOLE_KEY" \
-H 'Content-Type: application/json' \
-d '{"known_host_key": "SHA256:<new fingerprint>"}' \
"https://mcp.sallyport.cloud/v1/ssh-hosts/<host-id>"Choose which commands wait for you
The new connection goes to every active agent of its workspace and environment. Commands run without asking by default.
To approve commands, open the agent in Agents, find the connection in its Access list and turn on Ask every call. Or set one class at a time:
- Read: plain read commands from a fixed list, such as
ls,cat,tail,git status,docker psandkubectl get. - Destructive: commands such as
rm,dd,mkfs,kubectl deleteanddocker system prune. - Write: everything else. A pipe,
;, a redirect,$, a wildcard,sudoorsh -cmakes a command a write, even when it only reads.
The approval card shows the host and the exact command. That command, byte for byte, is what runs.
Run a command
The agent keeps its Sallyport MCP connection. list_access names the host’s tool, which ends in _exec. The tool takes these arguments:
| Argument | Meaning |
|---|---|
cmd | The whole command, as you would type it in a shell. Required. |
timeout_s | Stops the command after this many seconds. A command stops after 5 minutes in any case. |
intent | One sentence on why, shown to the person who approves. |
call_id | Continues a call that waits for approval. |
max_inline_bytes | How much output comes in the answer. 24 KiB by default. |
{
"cmd": "df -h",
"intent": "Check free disk space before the deploy"
}Once the agent has an SSH host, it also gets ssh_exec. It takes the same arguments plus host. A host outside the agent’s list gives a link where you grant access.
The same host gives the agent its files too. _sftp_read and _sftp_write list, read, write, rename and delete them over SFTP with this key. See Files over SFTP.
Read the result
- The answer carries
exit_code,stdoutandstderr. Output that is not UTF-8 arrives asstdout_base64orstderr_base64. - Long output is cut at
max_inline_bytes, andfetch_bodyreads the rest. One command may print up to 512 MiB. - A command gets no terminal and no input. Use flags that skip prompts, such as
apt-get -y. - Open the call in Activity to see SSH command result: the target, Exit code, Host-key fingerprint and output sizes.