Problem with ssh2_connect
| From: | Radek Krejča | Date: | Wed, 23 Jun 2010 13:22:43 +0000 |
| Subject: | Problem with ssh2_connect | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-306356@lists.php.net to get a copy of this message | ||
Hello,
I am trying connect to freebsd. I have php 5.3.2 installed. I have to connect using public keys, but
without succes. Function ssh2_connect throws me following error (then I have invalid resource for
function ssh2_auth_pubkey_file)...
PHP Warning: ssh2_connect(): Error starting up SSH connection(-5): Unable to exchange encryption
keys in /usr/home/radek/pokus.php on line 14
Warning: ssh2_connect(): Error starting up SSH connection(-5): Unable to exchange encryption keys in
/usr/home/radek/pokus.php on line 14
PHP Warning: ssh2_connect(): Unable to connect to test.starnet.cz in /usr/home/darius/pokus_nat.php
on line 14
Warning: ssh2_connect(): Unable to connect to test.starnet.cz in /usr/home/radek/pokus.php on line
14
Here is code:
<?php
$methods = array(
'kex' => 'diffie-hellman-group1-sha1',
'hostkey' => 'ssh-dss',
'client_to_server' => array(
'crypt' => '3des-cbc',
'mac' => 'hmac-md5',
'comp' => 'none'),
'server_to_client' => array(
'crypt' => '3des-cbc',
'mac' => 'hmac-md5',
'comp' => 'none'));
$connection = ssh2_connect('test.starnet.cz', 22,
array('hostkey'=>'ssh-rsa'), $methods);
?>
I got the same error without using methods variable.
Thank you for advice.
Radek