1libssh2_userauth_publickey_fromfillieb(s3s)h2 mlainbusaslh2_userauth_publickey_fromfile(3)
2
3
4
6 libssh2_userauth_publickey_fromfile - authenticate a session with a
7 public key, read from a file
8
10 #include <libssh2.h>
11
12 int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session,
13 const char *username, unsigned int username_len, const char *publickey,
14 const char *privatekey, const char *passphrase);
15
16 int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session,
17 const char *username, const char *publickey, const char *privatekey,
18 const char *passphrase);
19
20
22 session - Session instance as returned by libssh2_session_init_ex(3)
23
24 username - Remote user name to authenticate as.
25
26 username_len - Length of username.
27
28 publickey - Path and name of public key file. (e.g.
29 /etc/ssh/hostkey.pub)
30
31 privatekey - Path and name of private key file. (e.g. /etc/ssh/hostkey)
32
33 passphrase - Passphrase to use when decoding private key file.
34
35 Attempt public key authentication using a PEM encoded private key file
36 stored on disk
37
38
40 Return 0 on success or negative on failure. It returns LIB‐
41 SSH2_ERROR_EAGAIN when it would otherwise block. While LIB‐
42 SSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per
43 se.
44
45
47 LIBSSH2_ERROR_ALLOC - An internal memory allocation call failed.
48
49 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
50
51 LIBSSH2_ERROR_SOCKET_TIMEOUT -
52
53 LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED - The username/public key combina‐
54 tion was invalid.
55
56 LIBSSH2_ERROR_AUTHENTICATION_FAILED - Authentication using the supplied
57 public key was not accepted.
58
59
61 libssh2_session_init_ex(3)
62
63
64
65libssh2 0.15 1 Jun 2l0i0b7ssh2_userauth_publickey_fromfile(3)