Subject: libssh2_userauth_publickey_fromfile with public key

libssh2_userauth_publickey_fromfile with public key

From: caosuwei <caosuwei_at_gmail.com>
Date: Thu, 23 Sep 2010 17:37:27 +0800

Hi guys,
I want to use libssh2_suerauth_publickey_fromfile() to copy file to remote
sever.
But there are some questions:

1. why do I have to use public key or passphrase to do the authentication?
    If public key is NULL, the error message will be "Unable to open public
key file"

2. If I use
          libssh2_userauth_publickey_fromfile(session, username,
"/home/caosuwei/.ssh/id_rsa.pub", "/home/caosuwei/.ssh/id_rsa", "123456"));
    the error message will be "(-18) Username/PublicKey combination invalid"

   What should I do with it ?

Thanks.

-- 
caosuwei

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-09-23