SSH Nexus
Actions22
- Command Execution Actions
- File Operations Actions
- Network Device Actions
- System Information Actions
- Connection Health Actions
Overview
The node provides advanced SSH-based file operations, specifically supporting uploading files to a remote system over SSH. It is designed for secure and flexible file transfer scenarios where users want to automate the upload of binary files from n8n workflows to remote servers or devices accessible via SSH.
Typical use cases include:
- Deploying configuration files or assets to remote Linux servers.
- Uploading web content or application files to remote directories.
- Automating backups or file distribution in networked environments.
- Integrating with network devices or systems that support SSH file transfers.
For example, you can use this node to upload a compiled website bundle from a previous build step directly into a web server's document root directory on a remote machine.
Properties
| Name | Meaning |
|---|---|
| Configuration Mode | Choose how to configure the SSH connection: - Use Credentials: Use stored SSH credentials (recommended for security). - Dynamic Parameters: Use dynamic parameters from previous nodes or environment variables. |
| Dynamic Host | Hostname or IP address of the SSH server (required if using Dynamic Parameters mode). Supports expressions and environment variables. |
| Dynamic Port | SSH port number (default 22) when using Dynamic Parameters mode. Supports expressions and environment variables. |
| Dynamic Username | Username for SSH login (required if using Dynamic Parameters mode). Supports expressions and environment variables. |
| Dynamic Password | Password for SSH login (optional, supports expressions and environment variables). |
| Dynamic Private Key | Private key content for SSH authentication (optional, supports expressions and environment variables). |
| 📎 Input Binary Field | The name of the input binary field containing the file to be uploaded. Default is "data". This must match the binary property name from the previous node output. |
| 📂 Target Directory | The remote directory path where the file will be uploaded. The filename is taken from the binary data's original filename unless overridden. Required. |
| Options | Additional options for the upload operation: - File Name: Override the filename used for the uploaded file. - Preserve Permissions: Whether to preserve file permissions during transfer (default true). |
| Advanced Options | Collection of advanced settings: - Command Timeout (ms): Max time to wait for command completion (default 30000 ms). - Output Parsing: How to parse command output (smart, json, table, raw, none). - Continue on Error: Continue processing other items if some fail. - Cipher Override: Override SSH cipher selection for this operation. - Try Fallback Ciphers: Automatically try alternative ciphers if primary ones fail. - Retry Delay (ms): Delay between connection retry attempts. - Verbose Logging: Enable detailed debug logging. - Line Ending Style: CRLF (Windows) or LF (Unix) line endings. - Device Type: Select device type for optimized handling (generic, Cisco IOS, Aruba OS, etc.). |
Output
The node outputs an array of JSON objects, one per input item processed. For the "Upload File" operation, each output JSON object contains:
success: Boolean indicating whether the upload succeeded.path: The full remote path where the file was uploaded.message: A success message string.parseOutput: Reflects the output parsing setting used (usually true/false).
If the upload fails, the node throws an error unless "Continue on Error" is enabled, in which case it outputs an error object with details including the error message, stack trace, timestamp, resource, and operation.
No binary data is output by this operation since it uploads files rather than downloading or returning them.
Dependencies
- Requires an SSH server accessible from the n8n instance.
- Needs either stored SSH credentials or dynamic SSH connection parameters (host, port, username, password/private key).
- Uses the
node-sshlibrary internally for SSH connections and file transfers. - Temporary local file storage is used during upload (via
tmp-promiseand Node.js filesystem promises). - No additional external services are required beyond the SSH server.
Troubleshooting
Common Issues
- Invalid SSH connection parameters: Ensure hostnames, ports, usernames, and authentication methods are correct and reachable.
- Permission denied errors: Check SSH user permissions on the target directory and ensure the user has write access.
- Invalid or unsafe remote paths: The node prevents uploading to dangerous paths like
/etc,/var/log, or paths containing..or~. Use safe directories only. - Missing binary data: The specified binary input field must exist and contain valid binary data.
- Timeouts: Increase the command timeout in advanced options if uploads take longer than expected.
- Cipher incompatibility: If connection fails due to cipher issues, try adjusting cipher override settings or enable fallback ciphers.
Error Messages
"SSH credentials are required when using credentials mode": You must provide stored SSH credentials if using that mode."Dynamic host and username are required when using dynamic configuration mode": Both host and username must be set for dynamic mode."Invalid host format": Hostname contains invalid characters; only letters, numbers, dots, and hyphens allowed."Invalid port number": Port must be between 1 and 65535."Remote path cannot be empty": Target directory path is required."Potentially dangerous upload path": The path includes disallowed patterns for safety."Binary property name is required for file upload": The input binary field name must be specified."File upload failed": Indicates failure during file transfer; check SSH connectivity and permissions.
To resolve errors, verify all inputs, credentials, and network accessibility. Enable verbose logging for detailed debug information.
Links and References
- node-ssh GitHub repository - underlying SSH client library
- SSH File Transfer Protocol (SFTP) - protocol used for file uploads
- n8n Documentation - general workflow automation guidance