-
Notifications
You must be signed in to change notification settings - Fork 57
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
SSH2 fails after upgrading to PHP8.2 and Debian Bookworm - ssh2_auth_pubkey_file(): Authentication failed #74
Comments
Have tried to generate the keys like this but same error
|
I tried and it still doesn't work. I'm pretty sure I'm in the same boat here. In my case, I'm trying to use the SSH2 feature in WordPress to install and update, but no luck. Here are my logs in journalctl. It seems that all is well until PECL/SSH2 sends a disconnect.
|
After running the application submitted by the OP, I got the same error message. However, I noticed an error message in my sshd logs saying that rsa-ssh was not in "PubkeyAcceptedAlgorithms", which is strange, because it is. But anyhow. I decided to create keys using the following command
And now, the PHP script doesn't throw an error. However, it still not working. Here's what I get in my logs. What's weird is that, for the first time, I see that that it's accepting the keys:
|
After generating keys using the following formats:
Only |
If there is an issue with supported key formats then that is all libssh2. The extension is a wrapper around this library. The php extension has no knowledge of the protocol and formats supported. Remember that OpenSSH does not use libssh2. So although the ssh client might still work, libssh2 might not. They are not related in any way. Also remember that the ssh protocol not only uses a key pair for authentication but also for host identification. It might well be that the newer libssh2 version compiled for your platform does not support older host key formats. I'm closing the issue because this is not a problem in the php ssh2 extension. |
Thank you! I appreciate your quick reply and your direction. I'll move this conversation to libssh2. Hopefully, they can sort this out :) |
Ended up finding the solution. It has to do with permissions, generating the right key, and set the right configuration in WordPress. |
After upgrading to
Debian Bookworm
andPHP 8.2
it's no longer possible to connect to remote server via PHP and SSH2The public/private key works because it's possible to connect via command line
code
output
PHP
SSH client
SSH remote server
Generating public/private keys (the keys are created without passphrase)
The text was updated successfully, but these errors were encountered: