Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH SFTP "Signature verification failed" #27400

Open
MYDIH opened this issue Dec 17, 2024 · 0 comments
Open

SSH SFTP "Signature verification failed" #27400

MYDIH opened this issue Dec 17, 2024 · 0 comments

Comments

@MYDIH
Copy link

MYDIH commented Dec 17, 2024

Version: Deno 2.1.4

Hi,

I'm using the ssh2 npm package to connect to an sftp server. Very much like #24118 but without the mention of a missing digest, I can't initiate the connection properly using this code :

import { Client } from "npm:ssh2@latest";

const conn = new Client();
conn.on("error", function (err: Error) {
  console.log("SSH - Connection Error: " + err);
});
conn.on("ready", () => {
  console.log("Client :: ready");
  conn.sftp((err: Error, sftp) => {
    if (err) throw err;
    sftp.readdir("export", (err: Error, list: string[]) => {
      if (err) throw err;
      console.dir(list);
      conn.end();
    });
  });
}).connect({
  host: <host>,
  port: 22,
  username: <user>,
  password: <pwd>,
  algorithms: {
    kex: [
      "diffie-hellman-group14-sha1",
      "diffie-hellman-group1-sha1",
    ]
  },
  debug: console.log,
});
Socket connected
Remote ident: 'SSH-2.0-2.0'
Outbound: Sending KEXINIT
Inbound: Handshake in progress
<handshake>
Outbound: Sending KEXDH_INIT
Received DH Reply
Host accepted by default (no verification)
Host accepted (verified)
Outbound: Sending NEWKEYS
Inbound: NEWKEYS
Verifying signature ...
Signature verification failed
Outbound: Sending DISCONNECT (3)
SSH - Connection Error: Error: Handshake failed: signature verification failed
Socket ended
Socket closed

When using nodejs:

Socket connected
Remote ident: 'SSH-2.0-2.0'
Outbound: Sending KEXINIT
Inbound: Handshake in progress
<handshake>
Outbound: Sending KEXDH_INIT
Received DH Reply
Host accepted by default (no verification)
Host accepted (verified)
Outbound: Sending NEWKEYS
Inbound: NEWKEYS
Verifying signature ...
Verified signature
Handshake completed

The same is true using npm:[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant