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.

Resource Schema

Optional

PropertyDescription
active
Bool
If true, use this SFTP Host Key.
name
String
The friendly name of this SFTP Host Key.
private_key
String
The private key data.

Read Only

PropertyDescription
id
Int64
SFTP Host Key ID
key_type
String
SSH key type
fingerprint_md5
String
MD5 Fingerprint of the public key
fingerprint_sha256
String
SHA256 Fingerprint of the public key

Example Resource

resource "files_sftp_host_key" "example_sftp_host_key" {
  active = true
  name   = "My Key"
}

Resource Import

This Resource supports importing using the following syntax:

Example Import Command

# Sftp Host Keys can be imported by specifying the id.
terraform import files_sftp_host_key.example_sftp_host_key 1

Data Source Schema

Required

PropertyDescription
id
Int64
SFTP Host Key ID

Read Only

PropertyDescription
active
Bool
If true, use this SFTP Host Key.
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

Example Data Source

data "files_sftp_host_key" "example_sftp_host_key" {
  id = 1
}