SSH Nexus
Actions22
- Command Execution Actions
- File Operations Actions
- Network Device Actions
- System Information Actions
- Connection Health Actions
Overview
This node enables executing multiple SSH commands sequentially on a remote system using either stored SSH credentials or dynamic connection parameters. It is designed for advanced SSH automation, particularly useful for network administrators and DevOps engineers who need to run command lists on servers or network devices securely and efficiently.
Typical use cases include:
- Running batches of diagnostic or configuration commands on network equipment (Cisco, Juniper, Aruba, etc.).
- Automating routine server maintenance tasks by executing shell commands remotely.
- Collecting system information or logs from multiple devices in a workflow.
- Integrating with dynamic environments where SSH connection details are provided at runtime.
For example, you can provide a list of commands like show version, show interfaces, and ping 8.8.8.8 to be executed one after another on a Cisco router, with configurable delays and output parsing options.
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 for SSH connection (required if using Dynamic Parameters mode). Supports expressions and environment variables. |
| Dynamic Port | SSH port number (default 22) for 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). |
| Commands List | Multiline text input of commands to execute sequentially (one per line). Supports comments starting with # and empty lines to separate command groups. Used for "Execute Command List" operation. |
| Wait Time Between Commands (ms) | Delay in milliseconds between executing each command to avoid overwhelming the remote system (default 1000 ms). |
| Advanced Options | Collection of additional settings: - Command Timeout (ms): Max time to wait for each command to complete (default 30000 ms). - Output Parsing: How to parse command output ( smart, json, table, raw, none).- Continue on Error: Whether to continue processing remaining commands if some fail. - Cipher Override: Select specific SSH ciphers to override credential defaults. - 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: Choose CR+LF (Windows) or LF (Unix) line endings. - Device Type: Select network device type for optimized command handling (e.g., Cisco IOS, Aruba OS, Juniper, etc.). |
Output
The node outputs JSON objects containing detailed results of the executed commands:
For Execute Command List operation:
commands: An array of command result objects, each including:command: The executed command string.exitCode: Exit code returned by the command.stderr: Standard error output.parseOutput: The chosen output parsing method.- Parsed output fields depending on parsing mode, e.g., raw text, JSON, table format, or smart parsed data.
commandIndex: Index of the command in the list.totalCommands: Total number of commands executed.
If binary data is involved (not applicable for this operation), it would be included in the
binaryproperty.
Each output item is paired with the corresponding input item index for traceability.
Dependencies
- Requires an SSH server accessible via network.
- Needs either stored SSH credentials configured in n8n or dynamic SSH connection parameters supplied at runtime.
- Uses the
node-sshlibrary for SSH connections. - Relies on internal utility functions for SSH parameter validation, connection configuration, and output parsing.
- Optional verbose logging requires console access for debug messages.
Troubleshooting
- Invalid host format: The dynamic host must only contain letters, numbers, dots, and hyphens. Avoid spaces or special characters.
- Port number out of range: Ensure the SSH port is between 1 and 65535.
- Empty command list: Provide at least one non-empty command; otherwise, the node throws an error.
- Potentially dangerous commands blocked: Commands like
rm -rf /,dd if=/dev/zero,mkfs,shutdown, andrebootare blocked for safety. - SSH connection failures: May occur due to wrong credentials, network issues, or incompatible cipher algorithms. Enabling fallback ciphers or adjusting cipher selection may help.
- Timeouts: Increase the command timeout if commands take longer than expected.
- Parsing errors: If output parsing fails, try switching to
Raw TextorNo Parsingmodes. - Continue on Error: Enable this option to allow the node to process all commands even if some fail, which helps in batch operations.