ERROR: Connection lost before handshake

Hey,

I’ve installed n8n using npm on Manjaro Linux. I’m trying to execute SSH commands using n8n on my local machine.

The error I’m getting: ERROR: Connection lost before handshake

Stack:

Error: Connection lost before handshake
    at makeError (/usr/lib/node_modules/n8n/node_modules/ssh2/lib/protocol/utils.js:142:15)
    at /usr/lib/node_modules/n8n/node_modules/ssh2/lib/client.js:693:13
    at Socket.<anonymous> (/usr/lib/node_modules/n8n/node_modules/ssh2/lib/client.js:748:7)
    at Socket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Host: localhost
Port: 5678

Any ideas what could be wrong?

Thanks!

Hey @alazanski,

That port you have listed is that your ssh server port locally?

If you are using npm and want to run os commands the execute command node would allow this without needing to run a local ssh server.

Hey @Jon,

Yeah, my bad; the Execute Command node is the way to go. :smile:

Thanks!

1 Like

ive had this recently, had to reboot the machine I was SSHing to to stop this error, even when using any SSH function, normally happens when a flow I’ve been running takes ages and then dies for some reason.