Subject: | Unable to authenticate using only private key |
Date: | Thu, 3 Sep 2015 15:55:38 +0100 (BST) |
To: | bug-Net-SSH2 [...] rt.cpan.org |
From: | Peter Stokes <peter [...] dadeos.co.uk> |
Hi,
I am attempting to use Net::SSH2 version 0.53 in a scenario where I only have
access to the private key (i.e. I do not have convenient access to the
associated public key), yet the Net::SSH2::auth_publickey() function, and
associated Net::SSH2::auth() function, require the public key to be provided.
It appears that the "publickey" parameter to the underlying call to
"libssh2_userauth_publickey_fromfile_ex()" may be NULL when "libssh2 is built
against OpenSSL" (see:
http://www.libssh2.org/libssh2_userauth_publickey_fromfile_ex.html), as it is
possible to generate the public key from the private key. However the parameter
validation performed by the Net::SSH2::auth_publickey() and Net::SSH2::auth()
functions appear to make it impossible to arrange for the "publickey" parameter
passed to the call to "libssh2_userauth_publickey_fromfile_ex()" to be NULL.
Would it be possible to modify Net::SSH2 in order to avoid the requirement to
provide a public key file? (e.g. support "Net::SSH2::auth_publickey(username,
undef, private key [, password]);" or similar).
Thanks
Peter