I want to connect to another server by ssh using PHP but i get error as below .i looked for it very much but couldn't find any suitable solution for me.
Warning: ssh2_connect(): Error starting up SSH connection(-1): Failed sending banner in ... Warning: ssh2_connect(): Unable to connect to ...
this is my php code :
$connection = ssh2_connect($details[0]['address'], $details[0]['port']);
ssh2_auth_password($connection, $details[0]['username'], $details[0]['password']);
Trying to diagnose issues with libssh2 is nigh impossible. My recommendation: use phpseclib, a pure PHP SSH implementation, and assuming that doesn't resolve the issue you can get logs that'll assist in the diagnosis. eg.