Saving to SFTP Storage
Introduction
This tutorial is designed to guide you through saving files to an SFTP (SSH File Transfer Protocol) server, a secure method for file transfer over a network.
Upon completing this tutorial, you will be proficient in setting up a destination object for SFTP file transfer, including configuration for both password and private key authentication.
Supported Protocols
Protocol | Description |
---|---|
sftp:// | SSH File Transfer Protocol |
1Setting Up an SFTP Server
- Choose SFTP server software (like OpenSSH) and install it on your server.
- Configure the server, including user accounts and access permissions.
2Finding Your SFTP Credentials
- For password authentication, use your server account username and password.
- For key-based authentication, generate an SSH key pair and configure the public key on the server.
Destination Object Structure
"destination": {
"url": "sftp://hostname_or_ip/path",
"key": "username",
"secret": "password or private key"
}
Attributes of SFTP Destination Object
Attribute | Description |
---|---|
url | Your SFTP Destination URL. Includes the hostname or ip, port if applicable, and path. |
key | Your Wasabi storage account name. |
secret | Your Wasabi storage account key. |
permissions | Specifies object access permissions. The default value is ‘private’ meaning the object is not publicly accessible with its URL. In case you want your objects to be accessed publicly, specify ‘public-read’ as a value for permissions. |
URL Structure for SFTP
The SFTP url consists of a hostname or IP address, port, and path. Check the examples for single file and ABR formats like HLS and DASH below:
sftp://[hostname_or_ip][:port]/[path]
When saving ABR outputs like HLS or DASH, please specify the path to a folder where the contents of the HLS or DASH stream should be located:
sftp://[hostname_or_ip][:port]/folder
hostname_or_ip | The IP address or hostname of your SFTP server.Optional. The default port for SFTP is 22. |
port | Optional. The port number. |
path | Path within your bucket where the file will be saved. |
Destination Object Example
"destination": {
"url": "sftp://example.com/my-folder/output.mp4",
"key": "myUsername",
"secret": "myPassword"
}
"destination": {
"url": "sftp://example.com/my-folder/output.mp4",
"key": "myUsername",
"secret": "ssh_rsa_key:-----BEGIN RSA PRIVATE KEY-----\nMIIEo...V7Q==\n-----END RSA PRIVATE KEY-----"
}
When saving ABR outputs like HLS or DASH, please specify the path to a folder where the contents of the HLS or DASH stream should be located:
"destination": {
"url": "sftp://example.com/my-folder",
"key": "myUsername",
"secret": "myPassword"
}
Considerations for SFTP
Generating an SSH Key Pair (for Key-based Authentication)
- Use a tool like ssh-keygen to generate a new SSH key pair.
- Store the private key securely and add the public key to the SFTP server.
-
Security: SFTP is secure by default as it operates over SSH.
-
Key-based Authentication: It is recommended for enhanced security.
-
Connection Issues: Verify the server's IP, port, and authentication details.
-
Key-based Authentication: Ensure the public key is correctly set up on the server.