question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: ERR_GENERIC_CLIENT - This service allows sftp connections only

See original GitHub issue

I don’t know what needs to be done here!!

sftp.connect({
  host: 'host',
  port: '22',
  username: 'username',
  password: 'pass',
  debug: myDebug,
})

I am getting the following error.

DEBUG: Parser: IN_PACKETDATAAFTER, packet: USERAUTH_FAILURE
DEBUG: Client: password auth failed
CLIENT[sftp]: Exhausted all connection attempts. Giving up
DEBUG: Outgoing: Writing DISCONNECT (BY_APPLICATION)
Error: connect: All configured authentication methods failed after 2 attempts
    at Object.formatError (/Users/XXXX/dev/workspaces/proc-order-sync/node_modules/ssh2-sftp-client/src/utils.js:62:18)
    at Client.connectErrorListener (/Users/XXXX/dev/workspaces/proc-order-sync/node_modules/ssh2-sftp-client/src/index.js:98:21)
    at Object.onceWrapper (events.js:422:26)
    at Client.emit (events.js:315:20)
    at doNextAuth (/Users/XXXX/dev/workspaces/proc-order-sync/node_modules/ssh2/lib/client.js:415:12)
    at tryNextAuth (/Users/XXXX/dev/workspaces/proc-order-sync/node_modules/ssh2/lib/client.js:484:5)
    at SSH2Stream.onUSERAUTH_FAILURE (/Users/XXXX/dev/workspaces/proc-order-sync/node_modules/ssh2/lib/client.js:597:5)
    at SSH2Stream.emit (events.js:315:20)
    at parsePacket (/Users/XXXX/dev/workspaces/proc-order-sync/node_modules/ssh2-streams/lib/ssh.js:3682:10)
    at SSH2Stream._transform (/Users/XXXX/dev/workspaces/proc-order-sync/node_modules/ssh2-streams/lib/ssh.js:701:13) {
  code: 'ERR_GENERIC_CLIENT',
  custom: true

It looks like authentication is failing, although I can successfully connect with the same information using CyberDuck a MAC OS app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kaaljabrcommented, May 4, 2020

I got it fixed by doing the following:

tryKeyboard: true

and

client.on('keyboard-interactive', (name, instructions, instructionsLang, prompts, finish) => {
  console.log('name %s, instructions %s, instructionsLang %s, prompts', name, instructions, instructionsLang, prompts);
  finish([config.password]);
});
0reactions
theophilusxcommented, May 6, 2020

Well, all I can say is I’ve never needed to do that and all the ftp servers I’ve communicated with work fine. It could be that the remote server is configured to only allow authentication from the keyboard (which would be unusual). It certainly isn’t a ‘normal’ setup, but if it works…

– Tim Cross

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSH on but unable to connect (says only sftp) - Ask Ubuntu
This message from ssh : This service allows sftp connections only. Connection to <host> closed. is typical of this configuration in ...
Read more >
Locked myself out of Amazon EC2 SSH - This service allows ...
I get the following response: This service allows sftp connections only. Connection to [hostname] closed. I've successfully removed ForceCommand ...
Read more >
Connecting to a SFTP server with ssh2-sftp-client in a AWS ...
As mentioned by @Atef before the problem was that the SFTP Server is hosted outside of AWS and only granted access to whitelisted...
Read more >
SFTP Chroot Jail preventing SSH: This service allows sftp ...
This service allows sftp connections only. The usual culprit to this problem appears to occur when the sysadmin leaves ForceCommand ...
Read more >
Connect with a user in SFTP and SSH
The test gives : This service allows sftp connections only. Is it possible to run both ? I don't quite know what to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found