Can't ssh into Windows 11 Pro machine with n8n

Describe the problem/error/question

I want to ssh from n8n into a Windows 11 Pro account. From Linux to Windows it works, but not from n8n to Windows. I can’t specify a correct working directory. I tried the following:

  • C:\Temp
  • c:\Temp
  • “C:\Temp”
  • /c/Temp
  • C/:Temp

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

“Syntax error” or “can’t find path”, depending on the path.

Information on your n8n setup

  • n8n version: latest
  • Database (default: SQLite): postgresql 17
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker, npm, n8n self-hosted
  • Operating system: Debian 12

hello @Runningman-work

try without the working directory, as on Windows that may not work

Empty working directory is not accepted.

I saw that there is an article about this, but no fix yet in stable version: fix(SSH Node): Resolve working directory option failing on Windows server by ongdisheng · Pull Request #18448 · n8n-io/n8n · GitHub

in that case try with null value

Already tried that, receiveing the error “cannot read properties of null (reading ‘startsWith’)

You can try this solution

I set the shell for OpenSSH with the following command:

Set-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"; Restart-Service sshd

Now the node works, thanks a lot!