elasticio / sftp-component

SFTP component for the elastic.io platform
Apache License 2.0
2 stars 3 forks source link

Using the private key for authentication does not function properly #133

Closed MykytaDuniashev closed 3 days ago

MykytaDuniashev commented 1 month ago

Component Bug Report

Description

SFTP component fails to work with the private key authentication. The client generates a key pair - public and private keys. The private key should be put into the respective field in the SFTP component credentials. If everything is correct it should verify the credentials and establish a connection. However, the credentials can't be verified and hence, work properly.

Link to a Slack conversation.

Link to a conversation with ABMcloud that reported the issue

Component Version

1.7.0

Actual Result

During the verification process:

Warning
We were not able to verify your credential. Please try again or contact the admins of the service you are providing a credential for.
The reasons for that might be an invalid credential data (e.g. expired API key) or a temporal issue with the target service.

During the flow execution:

Error: connect: getConnection: All configured authentication methods failed
    at SftpClient.fmtError (/home/node/node_modules/ssh2-sftp-client/src/index.js:111:22)
    at SftpClient.connect (/home/node/node_modules/ssh2-sftp-client/src/index.js:249:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Sftp.connect (/home/node/lib/Sftp.js:56:5)
    at async TaskExec.processAction (/home/node/lib/actions/upload.js:17:3)

Expected Result

Credentials are verified and the component connects to a client server.

A3a3e1 commented 1 month ago

@MykytaDuniashev Please do ask the client - are they trying to use an RSA key? Or anything else, e.g. a ed25519 key?

A3a3e1 commented 1 month ago

I managed to connect via a Private key only auth method on our Hetzner server from the component

A3a3e1 commented 1 month ago

Updated the ssh2-sftp-client to 10.0.3 and tested with several different keys:

Added it to the Readme of the component

MarianaZaloha commented 1 month ago

https://github.com/elasticio/sftp-component/releases/tag/1.7.2