CURL.SetOptionSSHAuthTypes
--------------------------

Sets the SSL authentication types.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetOptionSSHAuthTypes"; curl; Value ) 

**MBS**( **"CURL.SetOptionSSHAuthTypes";** /\* Sets the SSL authentication types. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* The new types.e.g. 3 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | The new types. | 3 |

### Result

Returns "OK" on success.

### Description

Sets the SSL authentication types.  
Pass a number set to a bitmask consisting of one or more of CURLSSH\_AUTH\_PUBLICKEY, CURLSSH\_AUTH\_PASSWORD, CURLSSH\_AUTH\_HOST, CURLSSH\_AUTH\_KEYBOARD. Set CURLSSH\_AUTH\_ANY to let libcurl pick one.  
  
| CURLSSH\_AUTH\_ANY | -1 | all types supported by the server. |
|---|--:|---|
| CURLSSH\_AUTH\_NONE | 0 | none allowed, silly but complete. |
| CURLSSH\_AUTH\_PUBLICKEY | 1 | public/private key files. |
| CURLSSH\_AUTH\_PASSWORD | 2 | password. |
| CURLSSH\_AUTH\_HOST | 4 | host key files. |
| CURLSSH\_AUTH\_KEYBOARD | 8 | keyboard interactive. |
| CURLSSH\_AUTH\_DEFAULT | -1 | default. |

See also [SSH\_AUTH\_TYPES](https://curl.haxx.se/libcurl/c/CURLOPT_SSH_AUTH_TYPES.html) option in CURL manual.

### Examples

Use password, no private key:

 Set Variable \[$r ; Value: MBS ( "CURL.SetOptionSSHAuthTypes"; $curl ; 2+8 )\]  
Download file via SFTP to file on disk:

 Set Variable \[$curl ; Value:MBS ("[CURL.New](CURLNew.md)") \]  
\# set download URL, e.g. sftp://monkeybreadsoftware.net/test.jpg   
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; SFTP Download::URL )\]  
\# build file path on disk and open output file   
Set Variable \[$name ; Value:GetValue(SFTP Download::FileName ; 1)\]  
Set Variable \[$path ; Value:MBS ( "[Path.AddPathComponent](PathAddPathComponent.md)"; SFTP Download::FolderPath ; $name )\]  
Set Variable \[$r ; Value:MBS ("[CURL.CreateOutputFile](CURLCreateOutputFile.md)"; $curl ; $path )\]  
\# login only via password   
Set Variable \[$result ; Value:MBS ( "CURL.SetOptionSSHAuthTypes"; $curl ; 2+8 )\]  
\# set credentials   
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionUserName](CURLSetOptionUserName.md)"; $curl ; SFTP Download::UserName )\]  
Set Variable \[$result ; Value:MBS ("[CURL.SetOptionPassword](CURLSetOptionPassword.md)"; $curl ; SFTP Download::Password )\]  
\# run transfer   
Set Field \[SFTP Download::ErrorCode ; MBS ("[CURL.Perform](CURLPerform.md)"; $curl )\]  
\# check debug log for errors   
Set Field \[SFTP Download::Debug ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )\]  
\# free CURL session   
Set Variable \[$result ; Value:MBS ("[CURL.Release](CURLRelease.md)"; $curl )\]  
### See also

- [CURL.SetInputText](CURLSetInputText.md)
- [CURL.SetOptionFTPCreateMissingDirs](CURLSetOptionFTPCreateMissingDirs.md)
- [CURL.SetOptionPassword](CURLSetOptionPassword.md)
- [CURL.SetOptionQuote](CURLSetOptionQuote.md)
- [CURL.SetOptionSASLAuthZID](CURLSetOptionSASLAuthZID.md)
- [CURL.SetOptionSSHPrivateKeyfile](CURLSetOptionSSHPrivateKeyfile.md)
- [CURL.SetOptionSSLCertType](CURLSetOptionSSLCertType.md)
- [CURL.SetOptionSSLKeyType](CURLSetOptionSSLKeyType.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)
- [CURL.SetOptionUserName](CURLSetOptionUserName.md)

### Example Databases

- [CURL/CURL Custom Function](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Custom%20Function.shtml#4CustomFunctionAnchor_)

### Blog Entries

- [SFTP Upload with temporary file](https://www.mbsplugins.de/archive/2023-03-06/SFTP_Upload_with_temporary_fil/monkeybreadsoftware_blog_filemaker)
- [CURL Custom Function](https://www.mbsplugins.de/archive/2022-12-12/CURL_Custom_Function/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 15th January 2023

  
[CURL.SetOptionSASLIR](CURLSetOptionSASLIR.md) - [CURL.SetOptionSSHCompression](CURLSetOptionSSHCompression.md)

[HTML Version](CURLSetOptionSSHAuthTypes.shtml)