Hi,

 I'm having a problem with libssh2. I tried to connect my php program with 
FreeBSD server and send command via SSH but authentication error appears every 
time.

This is the error:

 Warning :  ssh2_auth_password() [ function.ssh2-auth-password ]: 
Authentication failed for root using password in  /var/www/1112.php  on line  8 

fail: unable to authenticate



This is a simple php script witch I use to connect to FreeBSD

<?php


 



 



 if(!($con = ssh2_connect("192.168.1.110", "22"))){



 


 echo "fail: unable to establish connection\n";



 } else {



 




 if(!ssh2_auth_password($con, 'root', 'qwerty')) {



 


 echo "fail: unable to authenticate\n";



 


 } else {

 


 


 



 


 



 


 if(!($stream = ssh2_exec($con, "uptime" )) ){



 


 


 echo "fail: unable to execute command\n";



 


 } 



 


 


 
// collect returning data from command



 


 


 else{


 


 

 



 


 


 stream_set_blocking( $stream, true );



 


 


 while( $buf = fread($stream,4096) ){



 






 echo "$buf";



 


 


 }



 


 


 


 



 


 


 fclose($stream);



 


 }



 


 }



 



 }

?>

When I try to connect from Ubuntu to FreeBSD everything is normal but when I 
try connect to FreeBSD server again there is authentication error.
Do you have idea where is the problem?

Regards
          
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
  • [no subject] sdcsdc sdcsdc
    • Re: Alexander Lamaison
      • Re: Peter Stuge

Reply via email to