Discussion:
newbies question on pubkey authentication
Florian, Heinz-Josef
2011-10-13 07:35:12 UTC
Permalink
Hi All,



as a newbie to ssh i try to write a client (on ms windows) with public key authentication.

The function ssh_userauth_offer_pubkey(..) returns SSH_AUTH_SUCCESS, fine.

Now I understand I have to read the associated private key and then to use the function

ssh_userauth_pubkey().

My question: how to retrieve the private key?

I cannot find the declaration of the function ssh_pki_import_privkey_file() (mentioned in the docs). Instead I find

int ssh_userauth_privatekey_file(ssh_session session, const char *username, const char *filename, const char *passphrase), being declared in libssh.h

But no variable to hold the private key.



Surely I'm missing something. Can you help?



Regards,

Heinz-Josef Florian


Erwin Peters Systemtechnik GmbH
Abteilungsleiter / Entwicklung
Josef-Baumann-Straße 37
44805 Bochum
Tel.: (+49) 0234-9325-0
Fax : (+49) 0234-9325-190
e-mail: hj.florian-***@public.gmane.org
WWW: http://www.epsystem.de <http://www.epsystem.de>



Geschäftsführer:
Friedrich Abriß, Thomas Fink
Sitz der Gesellschaft: Bochum
Amtsgericht Bochum HRB Nr. 7667
Andreas Schneider
2011-10-13 10:53:25 UTC
Permalink
Post by Florian, Heinz-Josef
Hi All,
Hi,
Post by Florian, Heinz-Josef
as a newbie to ssh i try to write a client (on ms windows) with public key authentication.
The function ssh_userauth_offer_pubkey(..) returns SSH_AUTH_SUCCESS, fine.
Now I understand I have to read the associated private key and then to use the function
ssh_userauth_pubkey().
My question: how to retrieve the private key?
I cannot find the declaration of the function ssh_pki_import_privkey_file()
(mentioned in the docs). Instead I find
You're probably looking at the wrong documentation. You should look at the
docs off the stable version instead of the current development branch :)
Post by Florian, Heinz-Josef
int ssh_userauth_privatekey_file(ssh_session session, const char *username,
const char *filename, const char *passphrase), being declared in
libssh.h
But no variable to hold the private key.
privatekey_from_file() ???

There is no need to hold it.


-- andreas
Florian, Heinz-Josef
2011-10-14 06:43:51 UTC
Permalink
Hi Andreas,

the function privatekey_from_file() (declared in legacy.h) did it.
Thank you.

Regards,

Heinz-Josef Florian
Andreas Schneider
2011-10-14 08:17:38 UTC
Permalink
Post by Florian, Heinz-Josef
Hi Andreas,
Hi,
Post by Florian, Heinz-Josef
the function privatekey_from_file() (declared in legacy.h) did it.
Thank you.
we will have a new PKI in libssh 0.6 which is a lot better and easier to use.
Post by Florian, Heinz-Josef
Regards,
Heinz-Josef Florian
-- andreas
--
Andreas Schneider GPG-ID: F33E3FC6
www.cryptomilk.org asn-***@public.gmane.org
Loading...