Note:
- This tutorial requires access to Oracle Cloud. To sign up for a free account, see Get started with Oracle Cloud Infrastructure Free Tier.
- It uses example values for Oracle Cloud Infrastructure credentials, tenancy, and compartments. When completing your lab, substitute these values with ones specific to your cloud environment.
Simplify Secure File Transfer with SFTPGo and Oracle Cloud Infrastructure Object Storage
Introduction
In an increasingly interconnected world, the need for secure and efficient file transfer solutions has become paramount. Whether it’s sharing sensitive data, collaborating on projects, or automating workflows, a reliable Secure File Transfer Protocol (SFTP) server can streamline these processes while ensuring data integrity and confidentiality. When it comes to leveraging the power of the cloud for such tasks, Oracle Cloud Infrastructure (OCI) stands out as a robust platform.
SFTPGo, an open-source SFTP server, provides a flexible foundation for managing file transfers, while Oracle Cloud Infrastructure Object Storage offers an efficient and scalable solution for storing and retrieving data.
Objectives
- Explore the seamless integration of SFTPGo and Oracle Cloud Infrastructure Object Storage to establish a secure and high-performance SFTP server within the OCI environment.
Prerequisites
- Access to an OCI tenancy.
Task 1: Enable S3 compatible API
Make sure you have S3 compatibility API enabled in your tenancy. For more information, see Object Storage Amazon S3 Compatibility API.
Task 2: Generate secret keys
Follow this documentation for generating secret keys. Keep the generated secret and access keys safe. We will require them in a later step.
Task 3: Create a Bucket
Create a bucket in the S3 compatible compartment you selected in Task 1.
Task 4: Set up SFTPGo on an OCI Instance
SFTPGo is fully featured and highly configurable SFTP server with optional HTTP/S, FTP/S and WebDAV support. Supported storage backends: local filesystem, encrypted local filesystem, Object Storage and is open source SFTPGo.
Create a new Virtual Machine and install and set up SFTPGo on this machine.
Note: You can choose to setup SFTPGo either on a Linux or on a Windows machine.
Once installed, you must log in to the admin portal and configure the Admin user account. Then you can log in using admin credentials and start setting up user accounts.
Task 5: Add Users in SFTPGo
-
Select Users from the navigation menu and click Plus button.
-
Configure the username and password for the user.
Task 6: Configure Oracle Object Storage for the User
-
On the Add user page, select Storage as S3 Compatible.
-
Leave the Home Dir field blank.
-
In the Bucket field, provide the Bucket Name.
-
In the Region field, provide the Region you want to use.
-
In the Access Key field, paste the Access key generated in Task 2.
-
In the Secret Key field, paste the Secret key generated in Task 2.
-
In the Endpoint field, paste the OCI S3 compatible url:
https://{namespace}.compat.objectstorage.{region}.oraclecloud.com
Note: Replace your
namespace
andregion
in the above mentioned url.You can also assign a folder in a bucket to a single user using the
key_prefix
option. Only the bucket assigned to the user is accessible to the user. -
Enable Use path-style addressing, i.e.,
endpoint/BUCKET/KEY
at the bottom of the section. -
Submit and save.
Task 7: Log in with the created user details and Verify
Log in as the user you just created, and verify that you homepage lists the content of the bucket.
Task 8: Verify using SFTP protocol
-
Log in using SFTP protocol by running the below sftp command. Replace the
username
,instance_ip
andsftp port
.sftp -P {sftp_port} {username}@{instance_ip}
-
Run the
ls
command and you should see the contents of your assigned bucket.
Note: Ensure the sftp port is open for ingress in Oracle Cloud virtual network security list.
Related Links
Acknowledgments
Author - Mayank Kakani (OCI Cloud Architect)
More Learning Resources
Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.
For product documentation, visit Oracle Help Center.
Simplify Secure File Transfer with SFTPGo and Oracle Cloud Infrastructure Object Storage
F86474-02
June 2024