1libssh2_userauth_publickey_fromfillieb(s3s)h2 mlainbusaslh2_userauth_publickey_fromfile(3)
2
3
4

NAME

6       libssh2_userauth_publickey_fromfile  -  authenticate  a  session with a
7       public key, read from a file
8

SYNOPSIS

10       #include <libssh2.h>
11
12       int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session,
13                                                  const char *username,
14                                                  const char *publickey,
15                                                  const char *privatekey,
16                                                  const char *passphrase);
17

DESCRIPTION

19       session - Session instance as returned by libssh2_session_init_ex(3)
20
21       username - Pointer to user name to authenticate as.
22
23       username_len - Length of username.
24
25       publickey   -   Path   name   of   the   public   key   file.     (e.g.
26       /etc/ssh/hostkey.pub). If libssh2 is built against OpenSSL, this option
27       can be set to NULL.
28
29       privatekey - Path name of the private key file. (e.g. /etc/ssh/hostkey)
30
31       passphrase - Passphrase to use when decoding privatekey.
32
33       Attempt public key authentication using a PEM encoded private key  file
34       stored on disk
35
36

RETURN VALUE

38       Return   0  on  success  or  negative  on  failure.   It  returns  LIB‐
39       SSH2_ERROR_EAGAIN  when  it   would   otherwise   block.   While   LIB‐
40       SSH2_ERROR_EAGAIN  is  a negative number, it isn't really a failure per
41       se.
42
43

ERRORS

45       LIBSSH2_ERROR_ALLOC -  An internal memory allocation call failed.
46
47       LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
48
49       LIBSSH2_ERROR_SOCKET_TIMEOUT -
50
51       LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED - The username/public  key  combina‐
52       tion was invalid.
53
54       LIBSSH2_ERROR_AUTHENTICATION_FAILED - Authentication using the supplied
55       public key was not accepted.
56
57

SEE ALSO

59       libssh2_session_init_ex(3)
60
61
62
63libssh2 0.15                      1 Jun 2l0i0b7ssh2_userauth_publickey_fromfile(3)
Impressum