Skip to content

ftp.ConnectWithKeyFile

Creates an FTPClient instance that can be used to interact with an ftp server but using a key file to connect.

js
let client = ftp.ConnectWithKeyFile(protocol, host, port, username, keyFile);

Parameters

  • protocol - The ftp protocol for this connecton. At the moment, only sftp is supported.
  • host - The ftp host like a domain name or an ip address.
  • port - The port to use on the ftp connection.
  • username - The username to use.
  • keyFile - A key file.

Example

js
let client = ftp.ConnectWithKeyFile(
    "sftp", 
    "example.domain.com", 
    22, 
    "brad", 
    "/path/to/key_file"
);