Difficulty configuring SFTP credentials

I’m having trouble configuring the SFTP credential, I believe it’s the “private key”. I tested it in the terminal and it worked, but when I test it in n8n self-hosted, it returns an error

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(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.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@Caio_Lima_Santos, welcome to the n8n community.
Ignore the test, it doesn’t work for SFTP, the actual validation only happens at execution.

@Caio_Lima_Santos that error is misleading — “No testing function found for this credential” doesn’t mean your private key is broken, it just means n8n’s SFTP credential type doesn’t have a built-in test endpoint. so the Test button can never succeed for SFTP creds regardless of whether they actually work.

to actually verify, create a quick workflow with an SFTP node (List action pointed at /), connect your credential to it, and hit Execute. if that runs successfully you’re fine — the test button error was just noise.

if it errors with a real auth message when actually used, the most common cause is private key format. n8n’s ssh2 lib wants OpenSSH format (keys generated with ssh-keygen -t ed25519 or older RSA keys converted in place with ssh-keygen -p -o -f your_key — it’ll prompt for old/new passphrase, just hit enter twice if there isn’t one).

I’ll do the test, yesterday I spent the whole day trying to format the private key, thinking it was wrong

Good morning, I did a test listing a folder on SFTP and it worked. Thank you

You’re welcome @Caio_Lima_Santos!
I kindly ask that you mark the best answer as a solution so that other community members can search for information more effectively before opening a new question. Good luck and count on us!