Can't use N8N to SSH into localhost

Describe the problem/error/question

I am trying to use the SSH node to SSH into localhost that n8n is deployed on.

What is the error message (if any)?

Couldn’t connect with these settings

No testing function found for this credential.

Please share your workflow

I am creating a new credentials to connect to either
localhost
the internal IP of the n8n server
the external IP of the n8n server
with a private key.  I am testing the connection in the credentials page.  Each time the SSH failed.  This server is set up deployed just like all the other 40+ servers I have, with the same user, private key, SSH setting.  I disabled the firewall and no change.

I ssh'ed into the n8n server, then ssh using those setting just fine.

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.107.4
  • Database (default: SQLite): Postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): not set
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 24.04

Hey @ckshen hope all is well.

If you n8n is running in docker and you wish to connect to the host machine, you need to:

  • Use correct IP address, which could be:
    • ip of n8n container default gateway
    • ip of docker interface on the host machine
    • another ip on the host machine
    • host.docker.internal for certain setups
  • make sure SSH service listens for connections on the ip you chose above, or listens on 0.0.0.0
  • make sure there are no firewall rules preventing such connection
1 Like

Thank you. Forgot about docker.

SSH host: 172.17.0.1

Set firewall setting accordingly.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.