From: Brandon Rampersad on
Do you have lexneter installed. I think that could be the problem.

2010/6/23 Radek Krejèa <radek.krejca(a)starnet.cz>

> >
> > Make sure that....
> >
> > .... the key file exists by that name in the location you're
> > specifying (hint: use a full path).
> Its in ssh2_auth_public..., yes, I am using full path there.
> > .... it is the right key for that server.
> Yes, I use it with ssh command from line on the same computer.
> > .... the permissions on the file are very strict (chmod 0400
> ssh-rsa).
> My private key has 0400
>
> >
> >
> > I got error message immediately after $connection = ssh2_connect('
> test.starnet.cz', 22, array('hostkey'=>'ssh-rsa'), $methods);, so
> $connection is invalid resource for other function.
>
> I have rsa keys, but if I use ssh-dss (hostkey), Its without warning - but
> I cant connect with keys.
>
> Radek
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
A Brandon_R Production
From: =?iso-8859-2?Q?Radek_Krej=E8a?= on

Do you have lexneter installed. I think that could be the problem.
2010/6/23 Radek Krejèa <radek.krejca(a)starnet.cz>
>
>    Make sure that....

What is lexneter please?
Radek
From: =?iso-8859-2?Q?Radek_Krej=E8a?= on
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