2009/10/3 sdcsdc sdcsdc <[email protected]>: > 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 mailing list is for support of the core libssh2 C library. PHP bindings and others make use of this library internally but add enough complexity on top of it that it makes it hard for us to diagnose problems. Also, many people here aren't familiar with PHP. A more appropriate venue for PHP support is http://pecl.php.net/package/ssh2. > 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); > } > } > > } > > ?> Thank you for trying to include sample code. However, most people here don't know PHP. Please try to reproduce your problem with an example written in C (the example programs included with libssh2 make a good starting point). Alex _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
