SSH Nexus
Advanced SSH automation hub with intelligent connection management and network device support. Built with ❤️ by Sarryaz
Actions22
- Command Execution Actions
- File Operations Actions
- Network Device Actions
- System Information Actions
- Connection Health Actions
Overview
The node provides SSH-based file operations on remote systems, specifically supporting the "List Directory" operation under the "File Operations" resource. It connects to a remote server via SSH and executes commands to list files and directories at a specified path. This is useful for workflows that need to inspect or manage remote file systems, such as automation scripts that monitor directory contents, trigger actions based on file presence, or gather metadata about remote files.
Practical examples:
- Listing log files in
/var/log/on a Linux server to check for recent errors. - Enumerating user home directories to verify backups.
- Inspecting contents of web server directories before deployment.
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). 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 if using private key). Supports expressions and environment variables. |
| Dynamic Private Key | Private key content for SSH authentication (optional if using password). Supports expressions and environment variables. |
| File/Directory Path | Full path to the target file or directory to list (required). Examples: /home/user/documents or /var/log/. |
| Advanced Options | Collection of advanced settings: - Command Timeout (ms): Max wait time for command completion. - Output Parsing: How to process command output; options include Smart Parse, JSON Only, Table Format, Raw Text, None. - Continue on Error: Whether to continue processing other items if one fails. - Cipher Override: Select specific SSH ciphers for connection. - Try Fallback Ciphers: Automatically try alternative ciphers if primary ones fail. - Retry Delay (ms): Delay between connection retry attempts. - Verbose Logging: Enable detailed debug logs. - Line Ending Style: CR+LF (Windows) or LF (Unix) line endings. - Device Type: Select network device type for optimized handling (mostly relevant for network devices). |
Output
The output JSON object for the "List Directory" operation contains:
raw: The raw string output of thels -lacommand executed on the remote directory.lines: An array of non-empty lines parsed from the raw output.wordCount: Number of words in the output.stderr: Any error messages returned by the command.exitCode: Exit code of the command (0 indicates success).path: The directory path that was listed.parseOutput: The parsing mode used (e.g., smart, json, table, raw, none).
This structured output allows downstream nodes to easily analyze directory contents or handle errors.
No binary data is produced by this operation.
Dependencies
- Requires an SSH server accessible with valid credentials or dynamic parameters.
- Needs either stored SSH credentials configured in n8n or dynamic SSH connection parameters provided at runtime.
- Uses the
node-sshlibrary internally for SSH connections. - No additional external services are required beyond the SSH server.
Troubleshooting
- Invalid Path Errors: Paths starting with
~must be replaced with full home directory paths; otherwise, an error is thrown. - Connection Failures: Ensure correct host, port, username, and authentication method. Invalid host formats or ports outside 1-65535 range cause errors.
- Permission Issues: The SSH user must have permission to execute
ls -laon the target directory. - Parsing Errors: If output parsing is set incorrectly, the output may not be structured as expected. Try switching parsing modes.
- Timeouts: Increase the "Command Timeout" in advanced options if listing large directories takes longer than default 30 seconds.
- Dangerous Path Checks: Uploads and deletions reject unsafe paths like those containing
..,~, or system directories (/etc,/var/log). While listing does not have these restrictions, ensure paths are valid. - Verbose Logging: Enable verbose logging in advanced options to get detailed connection and command execution logs for debugging.