Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Sets the file path for your private key.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
curl | The CURL session handle. | $curl | |
Value | The new file path. | "c:\myprivatekey" | |
Encoding | The text encoding for text parameter. Default is UTF-8. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
"UTF8" | Optional |
Returns "OK" on success.
See also SSH_PRIVATE_KEYFILE option in CURL manual.
Login via SSH with public key:
Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; "sftp://test.com:1222/test.fmp12" ) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionVerbose"; $curl; 1) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUpload"; $curl; 1) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionConnectionTimeout"; $curl; 10) ]
#
# specify paths to keys, public key optional as it is usually included in private key file:
Set Variable [ $result ; Value: MBS("CURL.SetOptionSSHPrivateKeyfile"; $curl; "/Users/jameykey/.ssh/id_rsa") ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionSSHPublicKeyfile"; $curl; "/Users/jameykey/.ssh/id_rsa.pub") ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUserName"; $curl; CURL Test::Name) ]
#
# no password with private key!
// Set Variable [ $result ; Value: MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
#
# upload text or open a file path
Set Variable [ $d ; Value: "Just a little bit text. Have fun!" ]
Set Variable [ $result ; Value: MBS("CURL.SetInputText"; $curl; $d) ]
// Set Variable [ $result ; Value: MBS("CURL.OpenInputFile"; $curl; "/Users/test/Desktop/test.fmp12") ]
#
# do it!
Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ]
Set Field [ CURL Test::debug ; MBS("CURL.GetDebugAsText"; $curl) ]
Set Variable [ $result ; Value: MBS("CURL.Release"; $curl) ]
Created 18th August 2014, last changed 10th August 2020
CURL.SetOptionSSHKnownHosts - CURL.SetOptionSSHPublicKeyfile
Feedback: Report problem or ask question.