Skip to content
Discussion options

You must be logged in to vote

We use libssh2_userauth_publickey_frommemory to authenticate using [email protected], [email protected], and [email protected] certificates. The trick is to read the accompanying -cert.pub file into memory and supply it as the public key data in the call to libssh2_userauth_publickey_frommemory.

More generally, when encountering LIBSSH2_ERROR_AUTHENTICATION_FAILED, you need to determine why the authentication failed. Logging can help here. You can set the logging level with libssh2_trace(session, IBSSH2_TRACE_KEX | LIBSSH2_TRACE_AUTH | LIBSSH2_TRACE_PUBLICKEY | LIBSSH2_TRACE_ERROR) and then set a logging handler with libssh2_trace_sethandler.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@MichaelBuckley
Comment options

Answer selected by brackleian
@brackleian
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants