> 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 ?
=> Please check that you have generated public and private key-pair on your system. Then you need to copy contents of your public key into authorized_keys2 file of remote computer. Remote computer is to which you need to connect.
>
> Thanks.
>
> --
> caosuwei
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-09-23