www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: Why does libssh2_userauth_publickey_fromfile_ex() require a public key?

Re: Why does libssh2_userauth_publickey_fromfile_ex() require a public key?

From: Joe Turpin <joe.turpin_at_gmail.com>
Date: Tue, 19 Jun 2012 15:49:54 -0400

On Thu, Jun 14, 2012 at 4:28 PM, Casper Langemeijer
<casper_at_langemeijer.eu>wrote:

> Hi All,
>
> A PHP user writes:
>
> "Every other ssh client I've ever dealt with, only requires the private
> key to authenticate to a remote server with ssh2.
>
> What is the reason for requiring both the public and private keys for
> authenticating, when in reality only the private key is required? The
> public key should be easily extracted from private key, and should be
> handled silently by PHP."
>
> I think he raises an interesting point. What can you say on the subject?
>
> For reference: https://bugs.php.net/bug.php?id=59409
>
> Greetings, Casper
>

Hi Casper,

It's not required. You can pass a NULL pointer in to the function for the
public key file parameter and it will use the private key file parameter
instead.

--Joe

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-06-19

the libssh2 team