Open darkpixel opened 7 years ago
Running 2016.0.0.0.
@darkpixel Thanks for the report. It appears mscdex is sending back an empty list of authentication methods that can continue in the SSH_MSG_USERAUTH_FAILURE message.
The SSH spec only mentions that "its RECOMMENDED that servers only include those 'method name' values in the name-list that are actually useful".
Perhaps other SSH clients only use this "list of authentication methods that can continue" as a hint, and attempt to use other authentication methods anyway. However, this is not how authentication is currently implemented in SSH.NET.
I'll try to reproduce this issue later this week (no guarantees, busy as hell lately).
Thanks for looking into it. I'll check with with the NodeJS ssh2 guys and see if they have any input.
Passing back ctx.reject(['publickey'])
causes SSH.NET to connect successfully. I appreciate the help @mscdex and @drieseng.
I have an SSH server running built off the https://github.com/mscdex/ssh2 NodeJS library.
I am able to authenticate to it using a keypair from Linux using the standard SSH client in Ubuntu, and I am able to connect to it via PuTTY w/ Pageant, but I can't connect using SSH.NET.
All three (PuTTY, the Ubuntu SSH client, and SSH.NET) are configured to authenticate with a keypair.
SSH.NET throws the following error:
Both the Linux SSH client and PuTTY behave the same way--they initially try to authenticate without sending an SSH key, fail, then re-authenticate with an SSH key.
SSH.NET on the other hands tries to authenticate without sending a key, then gives up and throws:
I'm not too familiar with the SSH protocol, but I am testing with the first example in the 'Server Examples' section of the README at https://github.com/mscdex/ssh2
All three are also able to successfully authenticate to my 'real' SSH server built into Ubuntu (OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8, OpenSSL 1.0.1f 6 Jan 2014) using a keypair for authentication.
Debugging info from the server side:
Connecting to my NodeJS SSH2 server using Ubuntu's SSH client results in the following debug info:
Attempting the same connection with SSH.NET gives the following debug output:
I'm don't know enough about the inner workings of SSH to know if this is a problem with the SSH.NET library, the NodeJS SSH2 library, or I'm missing something in the example, but I figured I would start here since other clients can connect without a problem.
Any pointers you can give me would be appreciated. If I should open this against the NodeJS SSH2 library, let me know and I can start there instead.
Thanks