while connect my destination server by
ssh2_connect("<<server-ip>>", 22)
then received error
ssh2_connect(): error starting up ssh connection(-5): unable to exchange encryption keys
- PHP version 7.4.29
- OS version CentOs Linux 7
ssh2 extention and lib2ssh 1.8.0 already installed
how to resolve this issue?
Does any library need to be added or updated?
2
Answers
Have you try to update libssh2?
This problem is common when the versions are outdated or don’t have matching encryption settings.
First remove the old version of libssh2 from this command:
Then, download and install the latest version:
After installation, verify the version of libssh2
Now, uninstall and reinstall the PHP ssh2 extension
Restart your webserver( no sure which webserver you are using)
If this update cannot fix your issue you have to update the key exchange algorithms on the server. So update me and I will help you out.