The SSH block connects to remote servers using the Secure Shell protocol, supporting both password and private key (OpenSSH format) authentication. It provides direct command execution and file system access on any server reachable over SSH.
With SSH, you can:
- Run commands and scripts: Execute shell commands or upload and run multi-line scripts with a configurable interpreter
- Manage the file system: Upload, download, read, write, move, rename, and delete files and directories
- Inspect the remote environment: Check whether a command or path exists, list directory contents, and retrieve system information such as OS, architecture, uptime, and disk/memory usage
In Zoen, the SSH block allows your agents to operate remote servers as part of a workflow—running commands and scripts, transferring and manipulating files, and gathering system diagnostics—all through authenticated SSH connections. This makes it possible to automate server administration, deployment steps, and remote data processing directly from an agent's workflow.
Execute commands, transfer files, and manage remote servers via SSH. Supports password and private key authentication for secure server access.
Execute a shell command on a remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
command | string | Yes | Shell command to execute on the remote server |
workingDirectory | string | No | Working directory for command execution |
| Parameter | Type | Description |
|---|
stdout | string | Standard output from command |
stderr | string | Standard error output |
exitCode | number | Command exit code |
success | boolean | Whether command succeeded (exit code 0) |
message | string | Operation status message |
Upload and execute a multi-line script on a remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
script | string | Yes | Script content to execute (bash, python, etc.) |
interpreter | string | No | Script interpreter (default: /bin/bash) |
workingDirectory | string | No | Working directory for script execution |
| Parameter | Type | Description |
|---|
stdout | string | Standard output from script |
stderr | string | Standard error output |
exitCode | number | Script exit code |
success | boolean | Whether script succeeded (exit code 0) |
scriptPath | string | Temporary path where script was uploaded |
message | string | Operation status message |
Check if a command/program exists on the remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
commandName | string | Yes | Command name to check (e.g., docker, git, python3) |
| Parameter | Type | Description |
|---|
commandExists | boolean | Whether the command exists |
commandPath | string | Full path to the command (if found) |
version | string | Command version output (if applicable) |
message | string | Operation status message |
Upload a file to a remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
fileContent | string | Yes | File content to upload (base64 encoded for binary files) |
fileName | string | Yes | Name of the file being uploaded |
remotePath | string | Yes | Destination path on the remote server |
permissions | string | No | File permissions (e.g., 0644) |
overwrite | boolean | No | Whether to overwrite existing files (default: true) |
| Parameter | Type | Description |
|---|
uploaded | boolean | Whether the file was uploaded successfully |
remotePath | string | Final path on the remote server |
size | number | File size in bytes |
message | string | Operation status message |
Download a file from a remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Path of the file on the remote server |
| Parameter | Type | Description |
|---|
downloaded | boolean | Whether the file was downloaded successfully |
file | file | Downloaded file stored in execution files |
fileContent | string | File content (base64 encoded for binary files) |
fileName | string | Name of the downloaded file |
remotePath | string | Source path on the remote server |
size | number | File size in bytes |
message | string | Operation status message |
List files and directories in a remote directory
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
path | string | Yes | Remote directory path to list |
detailed | boolean | No | Include file details (size, permissions, modified date) |
recursive | boolean | No | List subdirectories recursively (default: false) |
| Parameter | Type | Description |
|---|
entries | array | Array of file and directory entries |
↳ name | string | File or directory name |
↳ type | string | Entry type (file, directory, symlink) |
↳ size | number | File size in bytes |
↳ permissions | string | File permissions |
↳ modified | string | Last modified timestamp |
totalFiles | number | Total number of files |
totalDirectories | number | Total number of directories |
message | string | Operation status message |
Check if a file or directory exists on the remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
path | string | Yes | Remote file or directory path to check |
type | string | No | Expected type: file, directory, or any (default: any) |
| Parameter | Type | Description |
|---|
exists | boolean | Whether the path exists |
type | string | Type of path (file, directory, symlink, not_found) |
size | number | File size if it is a file |
permissions | string | File permissions (e.g., 0755) |
modified | string | Last modified timestamp |
message | string | Operation status message |
Create a directory on the remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
path | string | Yes | Directory path to create |
recursive | boolean | No | Create parent directories if they do not exist (default: true) |
permissions | string | No | Directory permissions (default: 0755) |
| Parameter | Type | Description |
|---|
created | boolean | Whether the directory was created successfully |
remotePath | string | Created directory path |
alreadyExists | boolean | Whether the directory already existed |
message | string | Operation status message |
Delete a file or directory from the remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
path | string | Yes | Path to delete |
recursive | boolean | No | Recursively delete directories (default: false) |
force | boolean | No | Force deletion without confirmation (default: false) |
| Parameter | Type | Description |
|---|
deleted | boolean | Whether the path was deleted successfully |
remotePath | string | Deleted path |
message | string | Operation status message |
Move or rename a file or directory on the remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
sourcePath | string | Yes | Current path of the file or directory |
destinationPath | string | Yes | New path for the file or directory |
overwrite | boolean | No | Overwrite destination if it exists (default: false) |
| Parameter | Type | Description |
|---|
moved | boolean | Whether the operation was successful |
sourcePath | string | Original path |
destinationPath | string | New path |
message | string | Operation status message |
Retrieve system information from the remote SSH server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
| Parameter | Type | Description |
|---|
hostname | string | Server hostname |
os | string | Operating system (e.g., Linux, Darwin) |
architecture | string | CPU architecture (e.g., x64, arm64) |
uptime | number | System uptime in seconds |
memory | json | Memory information (total, free, used) |
diskSpace | json | Disk space information (total, free, used) |
message | string | Operation status message |
Read the contents of a remote file
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
path | string | Yes | Remote file path to read |
encoding | string | No | File encoding (default: utf-8) |
maxSize | number | No | Maximum file size to read in MB (default: 10) |
| Parameter | Type | Description |
|---|
content | string | File content as string |
size | number | File size in bytes |
lines | number | Number of lines in file |
remotePath | string | Remote file path |
message | string | Operation status message |
Write or append content to a remote file
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SSH server hostname or IP address |
port | number | Yes | SSH server port (default: 22) |
username | string | Yes | SSH username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
path | string | Yes | Remote file path to write to |
content | string | Yes | Content to write to the file |
mode | string | No | Write mode: overwrite, append, or create (default: overwrite) |
permissions | string | No | File permissions (e.g., 0644) |
| Parameter | Type | Description |
|---|
written | boolean | Whether the file was written successfully |
remotePath | string | File path |
size | number | Final file size in bytes |
message | string | Operation status message |