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 - Remote user name to authenticate as.
22
23       username_len - Length of username.
24
25       publickey   -   Path   and   name   of   public   key    file.    (e.g.
26       /etc/ssh/hostkey.pub)
27
28       privatekey - Path and name of private key file. (e.g. /etc/ssh/hostkey)
29
30       passphrase - Passphrase to use when decoding private key file.
31
32       Attempt  public key authentication using a PEM encoded private key file
33       stored on disk
34
35

RETURN VALUE

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

ERRORS

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

SEE ALSO

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