Skip to content

SSH node fails to execute commands on Windows 11 OpenSSH server when n8n runs in Docker (path/shell handling issue) #23299

@zcemt

Description

@zcemt

Describe the problem/error/question

When using the SSH node → Execute Command against a Windows 11 OpenSSH Server, the node successfully establishes an SSH connection, but fails to execute any command.
The node reports “Node executed successfully”, however:
stdout is always empty
stderr consistently returns a Windows error equivalent to:
“The filename, directory name, or volume label syntax is incorrect.”
This happens even for trivial commands such as hostname.
The issue appears to be related to working directory handling and/or shell invocation on Windows targets.

  • Steps to Reproduce

Run n8n in Docker (Linux-based container).
Configure SSH node → Execute Command.
Target a Windows 11 machine with built-in OpenSSH Server enabled.

Set:
Working Directory: C:\ or C:\Windows\System32
Command: hostname
Execute the node.

Expected Behavior
hostname should return the Windows machine name in stdout.

Actual Behavior
SSH connection succeeds.
Node shows executed successfully.
stdout is empty.
stderr contains:
The filename, directory name, or volume label syntax is incorrect.

This occurs regardless of:
Working directory format (C:, C:/, ., etc.)
Command wrapping (cmd /c, cmd.exe /c, powershell.exe -Command)
Authentication method (password or key)

Additional Notes
Running the same commands manually via SSH works as expected:
ssh administrator@host "cmd.exe /c hostname"
Executing SSH commands from inside the n8n container using the system ssh binary (instead of the SSH node) works correctly.
This strongly suggests an issue in the SSH node’s command construction / shell / working directory handling for Windows targets.
The problem does not appear to be related to network, firewall, or authentication.

Suspected Cause
The SSH node seems to:
Apply cd logic in a way that is incompatible with Windows shells
Or execute commands without explicitly invoking cmd.exe / PowerShell, causing Windows path parsing to fail

Impact
This prevents reliable use of the SSH node for:
Managing Windows servers
Running PowerShell scripts
Automating Docker / system tasks on Windows via n8n

What is the error message (if any)?

Please share your workflow/screenshots/recording

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
⚠️ WARNING ⚠️ If you have sensitive data in your workflow (like API keys), please remove it before sharing.

Share the output returned by the last node

Debug info

core

  • n8nVersion: 2.0.2
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.21.0
  • nodeEnv: production
  • database: sqlite
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/143.0.0.0 safari/537.36 edg/143.0.0.0
  • isTouchDevice: false

Generated at: 2025-12-16T16:24:44.946Z}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions