SFTP Host Keys

An SFTP Host Key is a cryptographic key used to verify the identity of the server during an SFTP connection. This allows the client to be sure that it is connecting to the intended server, preventing man-in-the-middle attacks and ensuring secure communication between the client and Files.com.

Files.com allows you to provide custom SFTP Host Keys, which is particularly useful when migrating to Files.com from an existing SFTP server, allowing the Files.com platform to match your previously-installed host key for a seamless transition.

List SFTP Host Keys

Command

files-cli sftp-host-keys list

Output

Outputs a list of SftpHostKey objects according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

files-cli sftp-host-keys list

Show SFTP Host Key

Command

files-cli sftp-host-keys find

Output

Outputs a SftpHostKey object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Sftp Host Key ID.

Example Request

files-cli sftp-host-keys find \
  --id=1

Create SFTP Host Key

Command

files-cli sftp-host-keys create

Output

Outputs a SftpHostKey object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDefaultDescription
--active
boolean
falseIf true, use this SFTP Host Key.
--name=
string
The friendly name of this SFTP Host Key.
--private-key=
string
The private key data.

Example Request

files-cli sftp-host-keys create

Update SFTP Host Key

Command

files-cli sftp-host-keys update

Output

Outputs a SftpHostKey object according to the output format.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Sftp Host Key ID.
--active
boolean
If true, use this SFTP Host Key.
--name=
string
The friendly name of this SFTP Host Key.
--private-key=
string
The private key data.

Example Request

files-cli sftp-host-keys update \
  --id=1

Delete SFTP Host Key

Command

files-cli sftp-host-keys delete

Output

No output is returned.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Flags

FlagDescription
--id=
int64
Required
Sftp Host Key ID.

Example Request

files-cli sftp-host-keys delete \
  --id=1

The SftpHostKey Object

Some of the commands above return a SftpHostKey object. The attributes of this object are listed below.

AttributeDescription
active
boolean
If true, use this SFTP Host Key.
id
int64
SFTP Host Key ID
name
string
The friendly name of this SFTP Host Key.
key_type
string
SSH key type
fingerprint_md5
string
MD5 Fingerprint of the public key
fingerprint_sha256
string
SHA256 Fingerprint of the public key