Cloud & Infrastructure
◆Block
SSH Block
Execute remote commands and manage files over SSH/SFTP
The SSH block connects your workflow to remote servers over SSH. Use it to run shell commands and scripts, and to read, write, list, move, and manage files and directories over SFTP — all with password or private-key authentication.
Overview
| Property | Value |
|---|---|
| Type | ssh |
| Category | tools |
| Color | #1E1E2E |
When to Use
- Run a deploy or maintenance command on a remote host as part of a workflow.
- Execute a multi-line shell script (e.g. build, migrate, restart services).
- Read a remote configuration or log file into the workflow.
- Write or append generated content to a file on a server.
- List a directory, check whether a path exists, or inspect file metadata.
- Rename/move files, change permissions, and create or remove directories.
Configuration
Connection
- Host — SSH server hostname or IP (required).
- Port — SSH port, defaults to
22. - Username — SSH username (required).
- Authentication — choose
PasswordorPrivate Key. - Password — shown for password auth; stored as a secret.
- Private Key — PEM/OpenSSH key, shown for key auth; stored as a secret.
- Key Passphrase — optional passphrase protecting the private key.
Operation
Dropdown selecting one of 13 operations: execute_command, run_script, read_file,
write_file, append_file, delete_file, rename, file_stat, change_permissions,
list_directory, create_directory, remove_directory, check_exists.
Operation Inputs
- Command — shown for Execute Command.
- Script — shown for Run Script.
- Path — remote path, shown for all file/directory operations.
- Content — shown for Write File and Append File.
- New Path — destination, shown for Rename / Move.
- Permission Mode — octal mode (e.g.
755), shown for Change Permissions. - Recursive — toggle, shown for Create/Remove Directory.
- Encoding —
utf8orbase64, shown for read/write/append file.
Inputs & Outputs
- Inputs:
host(string) — SSH hostname or IPport(number) — SSH portusername(string) — SSH usernameauthType(string) —passwordorprivateKeypassword/privateKey/passphrase(string) — credentialsoperation(string) — operation to performcommand/script(string) — command or script to runpath(string) — remote pathcontent(string) — content to write/appendnewPath(string) — destination for renamemode(string) — octal permission moderecursive(boolean) — recursive directory operationencoding(string) — file content encoding
- Outputs:
stdout/stderr(string) — command outputcode(number) — exit codecontent(string) — file contents (read)entries(json) — directory listinginfo(json) — file metadata (stat)exists(boolean) — existence check resulterror(string) — error message on failure
Notes
- SSH and SFTP are not HTTP; the block's tools POST to an internal Zelaxy route
(
/api/tools/ssh) that opens the connection with the Nodessh2client and closes it after each operation. - The
ssh2package must be installed on the server for this block to run.