Overview
This node enables executing SSH operations on remote servers using AI-powered automation. It supports three main operations: executing shell commands, downloading files, and uploading files via SSH. This is useful for system administrators, DevOps engineers, or anyone needing to automate remote server management tasks within n8n workflows.
Practical examples include:
- Running maintenance scripts or gathering system info remotely.
- Downloading log files from a server for analysis.
- Uploading configuration files or deployment packages to a server.
Properties
| Name | Meaning |
|---|---|
| Connection Type | Choose between using stored credentials or dynamic parameters for connection details. |
| Authentication | Select authentication method: Password or Private Key. |
| Host | Hostname or IP address of the SSH server (required if using dynamic parameters). |
| Port | Port number of the SSH server (default 22, required if using dynamic parameters). |
| Username | Username for SSH authentication (required if using dynamic parameters). |
| Password | Password for SSH authentication (required if using password authentication). |
| Private Key | Private key string for SSH authentication (required if using private key authentication). |
| Passphrase | Passphrase for the private key, if applicable. |
| Operation | The SSH operation to perform: Execute Command, Download File, or Upload File. |
Additional properties depending on the selected operation:
Execute Command
- Command: Shell command to execute on the remote server.
- Working Directory: Directory where the command will be executed (default "~").
Download File
- Remote File Path: Full path to the file on the remote server to download.
- Binary Property Name: Name of the binary property to store the downloaded file.
Upload File
- Upload From: Source of upload content, either Binary Data or Text Content.
- Binary Input Field: Field name containing binary data to upload (if using binary).
- File Content: Text content to upload as a file (if using text).
- Remote Directory: Directory on the remote server to upload the file.
- Remote Filename: Name of the file on the remote server.
Output
For Execute Command:
- JSON output includes:
stdout: Standard output of the command.stderr: Standard error output.exitCode: Exit code of the command.success: Boolean indicating if exit code was zero.command: The executed command string.workingDirectory: Directory where the command was run.
- JSON output includes:
For Download File:
- JSON output includes:
success: true if download succeeded.operation: "downloadFile".remotePath: Path of the downloaded file.fileName: Name of the downloaded file.
- Binary output contains the downloaded file data under the specified binary property name.
- JSON output includes:
For Upload File:
- JSON output includes:
success: true if upload succeeded.operation: "uploadFile".remotePath: Full path of the uploaded file on the server.
- JSON output includes:
Dependencies
- Requires an SSH server accessible with provided credentials.
- Supports two authentication methods: password or private key (with optional passphrase).
- Uses the
node-sshlibrary for SSH connections. - Temporary files are created during file upload/download using
tmp-promise. - Requires appropriate permissions on the remote server for the requested operations.
Troubleshooting
- SSH connection failed: Indicates issues connecting to the SSH server. Check host, port, username, and authentication credentials.
- Invalid path error: Paths starting with
~must be properly formatted; only~/is supported as home directory shorthand. - Permission denied: Ensure the user has rights to execute commands or access files/directories on the remote server.
- File not found: Verify the remote file path exists when downloading or uploading.
- Binary data errors: When uploading binary data, ensure the input field contains valid binary content.
If the node is set to continue on fail, errors will be returned in the output JSON with success: false and an error message.