-
Notifications
You must be signed in to change notification settings - Fork 150
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
ED25519 key files cannot be loaded on Windows #285
Comments
Hello, Thanks for the interest and report. Have used ED25519 keys many times myself with no issues. Can you enable debug logging and post the complete output of the above code?
|
There are three blocks below. The first shows the output from enable_debug_logger. The second shows the output from the print() in my code. The third shows the successful authentication from the command line without entry of password. Note that Welcome to Ubuntu was shown three times after the first login from the command line, but only once the second time. I'm wondering if that is a result of the three unsuccessful authentications by parallel-ssh. Connecting to 192.168.0.201:22 Server connection (<class 'pssh.exceptions.AuthenticationError'>, AuthenticationError('Authentication error while connecting to %s:%s - %s', '192.168.0.201', 22, FileError()), <traceback object at 0x0000014BD4943D80>) PS C:\Windows\System32> ssh [email protected]
System information as of Mon Mar 8 20:58:26 UTC 2021 Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1029-raspi aarch64)
System information as of Mon Mar 8 20:58:26 UTC 2021 Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1029-raspi aarch64)
System information as of Mon Mar 8 20:58:26 UTC 2021 System load: 1.29 Temperature: 31.2 C ubuntu@ubuntu:~$ logout
System information as of Mon Mar 8 21:04:25 UTC 2021 System load: 1.0 Temperature: 37.0 C Last login: Mon Mar 8 20:58:28 2021 from 192.168.0.113 |
Can you show output of |
To get single \ in path to file on first line in Github Preview tab, I had to use \\ on the Github Write tab. Also, all the \\ on the Preview tab were \\\\ on the write tab and were copied directly from powershell.
|
Best to try generating the key on linux instead of windows - have used such keys on windows clients successfully. It looks like libssh2 might not be able to read windows generated key files. If you can attach a new key generated on windows here - one you are not using - that would be helpful to debug with. Also, can surround text blocks with ``` in order to stop github formatting it. |
I generated a new ED25519 key in Ubuntu 20.04 and tested on Windows SSH client without success. Then, I tested that key as well as a Windows generated key in Ubuntu SSH client and they both worked perfectly. Did you use Microsoft OpenSSH in Windows? Attached is a key generated on Windows. |
Have never used Window's ssh tools. OpenSSH generated keys on linux work on windows clients, by clients meaning this library, not window's openssh tools. The windows tools are supposed to be openssh so a key generated on linux openssh not working on windows openssh sounds like an openssh issue. |
I see that my terminology was not correct in our last exchange. I'll rephrase. Also, if the ED25519 file is replaced by an rsa file, it works in parallel-ssh in both OS. Password works, too. Here is stripped down code I used to test in both OS.
Aside from this issue, which I can work around, parallel-ssh is performing well for me. Thanks for your work. |
Have used ED25519 and ECDSA keys with parallel-ssh on windows, yes. Let me confirm they work with latest version as well. The only instance I've seen of them not working on Windows is from self-built ssh2-python that uses WinCNG instead of OpenSSL for a crypto back-end. Those key types are only supported with OpenSSL. If parallel-ssh was installed via pip, it has installed a binary wheel of ssh2-python with OpenSSL included. If self-building.. my only suggestion is don't. |
Testing has been done using two configurations, both including parallel-ssh installed with pip. The first configuration started with a minimal conda environment. The second was on a different computer with python installed directly in windows without use of any environment. |
Have been able to reproduce - ED25519 keys cannot be loaded on windows. Same key can be loaded on linux. ECDSA keys work on windows. It could be an issue with windows wheel builds or a bug with libssh2 - yet to confirm. |
Describe the bug
ED25519 key pairs don't work to connect to ubuntu server
To Reproduce
Expected behavior
The key pair should authenticate to allow communications.
Actual behaviour
The code fails with AuthenticationError.
Additional information
System: parallel-ssh v2.5.4, Win 10 Pro v10.0.19401, Microsoft openssh v7.7.2.1, Python v3.8.6, Ubuntu-server 20.04
The ED25519 key pair was created using ssh-keygen -t ED25519.
The key pair also fails when pkey is deleted and allow_agent=True
However, the same ED25519 key pair is used successfully to make a connection to the server using cli and ssh agent.
The same result occurred with a second ED25519 key pair.
If an rsa key pair is used instead, the code above works as expected after pkey is changed to the name of the rsa key.
The text was updated successfully, but these errors were encountered: