-
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
Cannot authenticate with a private key #363
Comments
@walac what is the remote SSH server you're trying to connect to, and what version? I've seen a problem that's very similar to yours. In my testing with Here's my example code and the result when trying to connect with I was able to "fix" my example by changing the import statement in line 4:
My understanding is that this changes the library internally used by I suppose the problem could be somewhere further down Edit: Please disregard the part about ED25519 key, it was an error in my testing. |
@V346Cen my SSH server is |
Hi, This sounds like a compatibility issue with OpenSSH 8.8 and libssh2. Please try the clients under To resolve the issue will need a newer libssh2 and ssh2-python - leaving this open to track. |
I had to investigate this further, so here's the outcome. Maybe it will be useful to someone who finds this thread before the problem is fixed. The problem is related to If SSH client connecting to such server is unable to use newer public key signature algorithms based on SHA-2, then it will not be able to connect using There are three possible workarounds at this point:
|
Option 3 does not work me against Amazon Linux 2023 and pssh using a SHA-256 rsa key. Same key used outside of pssh from command line works fine. For the record, I tried PubkeyAcceptedAlgorithms +ssh-rsa , PubkeyAcceptedKeyTypes +ssh-rsa, HostKeyAlgorithms +ssh-rsa while trying to get it to work for the short term. |
I want to add that this worked for me, thanks for the suggestion! |
I have the same problem, with both "rsa" and "ed25519" keys, see the code below. Both of the keys DO work on the same server (and same account), with the ssh terminal client. If I log in from the terminal with the verbose flag (-v), I get the following server side info:
Interestingly the same test code below DOES work with another server, that has the following ssh server side info:
|
hello @pkittenis , thank you, this worked for me. the different approach to loading
|
Describe the bug
When I try to connect to a host using a private key, it doesn't work. With the
ssh
command line client, it works fines.To Reproduce
Steps to reproduce the behavior:
podman run -p 2022:22 docker.io/walac/pyktest-ssh:latest
(the docker image is publicly available)Expected behavior
A connection to the remote host is established.
Actual behavior
Additional information
The text was updated successfully, but these errors were encountered: