New274+ blocks and 249+ tools are now fully documented
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

PropertyValue
Typessh
Categorytools
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 Password or Private 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.
  • Encodingutf8 or base64, shown for read/write/append file.

Inputs & Outputs

  • Inputs:
    • host (string) — SSH hostname or IP
    • port (number) — SSH port
    • username (string) — SSH username
    • authType (string) — password or privateKey
    • password / privateKey / passphrase (string) — credentials
    • operation (string) — operation to perform
    • command / script (string) — command or script to run
    • path (string) — remote path
    • content (string) — content to write/append
    • newPath (string) — destination for rename
    • mode (string) — octal permission mode
    • recursive (boolean) — recursive directory operation
    • encoding (string) — file content encoding
  • Outputs:
    • stdout / stderr (string) — command output
    • code (number) — exit code
    • content (string) — file contents (read)
    • entries (json) — directory listing
    • info (json) — file metadata (stat)
    • exists (boolean) — existence check result
    • error (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 Node ssh2 client and closes it after each operation.
  • The ssh2 package must be installed on the server for this block to run.