1CURLOPT_SSH_AUTH_TYPES(3)  curl_easy_setopt options  CURLOPT_SSH_AUTH_TYPES(3)
2
3
4

NAME

6       CURLOPT_SSH_AUTH_TYPES - set desired auth types for SFTP and SCP
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle,  CURLOPT_SSH_AUTH_TYPES, long
12       bitmask);
13

DESCRIPTION

15       Pass  a  long  set  to  a  bitmask  consisting  of  one  or   more   of
16       CURLSSH_AUTH_PUBLICKEY,    CURLSSH_AUTH_PASSWORD,    CURLSSH_AUTH_HOST,
17       CURLSSH_AUTH_KEYBOARD and CURLSSH_AUTH_AGENT.
18
19       Set CURLSSH_AUTH_ANY to let libcurl  pick  a  suitable  one.  Currently
20       CURLSSH_AUTH_HOST has no effect. If CURLSSH_AUTH_AGENT is used, libcurl
21       attempts to connect to ssh-agent or pageant and let the  agent  attempt
22       the authentication.
23

DEFAULT

25       None
26

PROTOCOLS

28       SFTP and SCP
29

EXAMPLE

31       CURL *curl = curl_easy_init();
32       if(curl) {
33         curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
34         curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES,
35                          CURLSSH_AUTH_PUBLICKEY | CURLSSH_AUTH_KEYBOARD);
36         ret = curl_easy_perform(curl);
37         curl_easy_cleanup(curl);
38       }
39

AVAILABILITY

41       CURLSSH_AUTH_HOST  was added in 7.16.1, CURLSSH_AUTH_AGENT was added in
42       7.28.0
43

RETURN VALUE

45       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
46       if not.
47

SEE ALSO

49       CURLOPT_SSH_HOST_PUBLIC_KEY_MD5(3), CURLOPT_SSH_PUBLIC_KEYFILE(3),
50
51
52
53libcurl 7.76.1                 November 04, 2020     CURLOPT_SSH_AUTH_TYPES(3)
Impressum