Syntax:

SETKEYFILE(key_file)

  • key_file: The file path of the .ppk or .pem file containing the key

 

Remarks:

  • SFTP provides additional authentication mechanisms such as the private key authentication. This way the user can use a certificate stored in a .ppk or .pem file to authenticate.
  • This command must be used before OPENHOST
  • User and or Password are optional in OPENHOST if SETKEYFILE is used.

 

Command history:

This command was added in ScriptFTP 4.3 (July 2017)

Examples:

 

SETPROTOCOL(SFTP)
SETKEYFILE("C:\my_key_files\test.ppk")
OPENHOST("127.0.0.1","myuser")
GETFILE("myfile.zip")
CLOSEHOST
SETPROTOCOL(SFTP)
SETKEYFILE("C:\my_key_files\test.pem")
OPENHOST("127.0.0.1","myuser")
GETFILE("myfile.zip")
CLOSEHOST
SETPROTOCOL(SFTP)
SETKEYFILE("C:\my_key_files\test.ppk")
OPENHOST("127.0.0.1","myuser","mypassword")
CLOSEHOST