RE: Problem with ssh2_connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, new symptoms...

So, I have following:

1. created rsa keys - tested over ssh command - on remote server is public key renamed to authorized_keys, on local machine i have both keys
2. rights on local machine:
-r--------   1 radek  wheel   1675 23 led  2007 radek
-r--------   1 radek  wheel    229 24 crv 10:05 radek.pub

3. rights on remote machine
-r--------  1 radek  wheel   402 Jun 26  2006 authorized_keys

4. script
----------------------------------------------------------------------------
<?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, $methods);

if (ssh2_auth_pubkey_file($connection, 'radek',
                          '/home/radek/.ssh/radek.pub',
                          '/home/radek/.ssh/radek')) {
  echo "Public Key Authentication Successful\n";
} else {
  die('Public Key Authentication Failed');
}
?>
----------------------------------------------------------------------------

5. result of script
php pokus.php 
Assertion failed: (session->userauth_pblc_method_len == _libssh2_ntohu32(pubkeydata)), function userauth_publickey, file userauth.c, line 982.
Abort trap: 6 (core dumped [obraz pameti ulozen])


6. if i use method ssh-rsa, i got message written in latest e-mail

7. both computers are FreeBSD, php from fresh ports

8. connection to Mikrotik over password (I cant use it there) withou problem (with this methods of course):

$methods = array(
  'kex' => 'diffie-hellman-group1-sha1',
   'client_to_server' => array(
   'crypt' => '3des-cbc',
   'comp' => 'none'),
   'server_to_client' => array(
   'crypt' => 'aes256-cbc,aes192-cbc,aes128-cbc',
    'comp' => 'none'));


What I have wrong?
Thank you

Radek
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux