Connect with S3 clients
S3 clients let you manage your buckets and files from the command line or a desktop application, without writing code. Use them for bulk transfers, scripts, and files larger than the 100 GB Portal limit.
To call FPT Object Storage from your own application, see SDK reference. For S3 Browser on Windows, see Use S3 Browser.
S3CMD
S3CMD is a command-line tool for Linux, Unix, and macOS for creating buckets and uploading, downloading, and organizing files.
Install S3CMD
CentOS/RHEL: s3cmd is available from the EPEL repository.
sudo yum install -y epel-release
sudo yum install -y s3cmd
Ubuntu/Debian:
sudo apt-get install s3cmd
macOS:
brew install s3cmd
For other operating systems, see the S3CMD download page.
Configure S3CMD
Before you start, prepare the Access Key, Secret Key, Endpoint, and Region from FPT Unify Portal. See Manage Access Keys.
-
Run the following command to start the configuration wizard:
s3cmd --configure -
Enter the following information when prompted:
Prompt Value Access Key Access Key obtained from FPT Unify Portal. Secret Key Secret Key obtained from FPT Unify Portal. Default Region Region of your bucket, as shown on FPT Unify Portal. S3 Endpoint Endpoint obtained from FPT Unify Portal, without https://, for examples3-hcm04.fptcloud.com.DNS-style bucket+hostname:port template for accessing a bucket %(bucket)s.s3-hcm04.fptcloud.comfor virtual-hosted-style access, ors3-hcm04.fptcloud.comfor path-style access. Do not keep the default Amazon value.Encryption password Leave it empty. Path to GPG program Press Enter to keep the default. Use HTTPS protocol Yes.HTTP Proxy server name Leave it empty. noteFPT Object Storage supports both virtual-hosted-style (
bucket-name.s3-hcm04.fptcloud.com) and path-style (s3-hcm04.fptcloud.com/bucket-name) access. Choose either one. -
When asked Test access with supplied credentials? [Y/n], enter
Y. S3CMD connects to FPT Object Storage and reports whether the credentials work. -
When asked Save settings? [y/N], enter
y. S3CMD saves the configuration to~/.s3cfg.warningThe default answer is
N. If you press Enter without typingy, the configuration is not saved.
You can also create or edit the ~/.s3cfg file directly instead of running the wizard. The following example uses virtual-hosted-style access:
[default]
access_key = YOUR_ACCESS_KEY
secret_key = YOUR_SECRET_KEY
bucket_location = YOUR_REGION
host_base = s3-hcm04.fptcloud.com
host_bucket = %(bucket)s.s3-hcm04.fptcloud.com
use_https = True
signature_v2 = False
For path-style access, set host_bucket to the same value as host_base, for example host_bucket = s3-hcm04.fptcloud.com.
Check the connection
s3cmd ls
If the list of your buckets appears, S3CMD is connected to FPT Object Storage.
Cyberduck
Cyberduck is a free desktop application for macOS and Windows that lets you upload, download, and manage files through a graphical interface.
Install Cyberduck
Download the version for your device from the Cyberduck download page, then run the installer.
Connect Cyberduck
- Open Cyberduck and click Open Connection, or select File → Open Connection.
- In the Open Connection dialog, enter the following information:
- Protocol: Amazon S3
- Server: the endpoint without
https://, for examples3-hcm04.fptcloud.com - Port:
443 - Access Key ID: your Access Key
- Secret Access Key: your Secret Key
- Click Connect. Your buckets appear in the Cyberduck window.
AWS CLI
AWS CLI is the official command-line tool for S3 and runs on Linux, macOS, and Windows.
Install AWS CLI
Linux:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Windows: run the following command in Command Prompt or PowerShell, then follow the installer.
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
For macOS and other options, see the AWS CLI installation guide.
Configure AWS CLI
-
Run the following command:
aws configure -
Enter the following information when prompted:
Prompt Value AWS Access Key ID Your Access Key. AWS Secret Access Key Your Secret Key. Default region name Region of your bucket, as shown on FPT Unify Portal. Default output format json -
Set the endpoint.
aws configuredoes not ask for one, so AWS CLI sends requests to Amazon S3 by default. With AWS CLI 2.13 or later, save the endpoint once:aws configure set endpoint_url https://s3-hcm04.fptcloud.comWith older versions, add
--endpoint-url https://s3-hcm04.fptcloud.comto every command instead.
Check the connection
aws s3 ls
If the list of your buckets appears, AWS CLI is connected to FPT Object Storage. If you did not save the endpoint, run aws s3 ls --endpoint-url https://s3-hcm04.fptcloud.com.
WinSCP
WinSCP is a free Windows application for transferring files over SFTP, SCP, FTP, and Amazon S3, with drag-and-drop support.
Install WinSCP
Download WinSCP from the WinSCP download page, then run the installer.
Connect WinSCP
- Open WinSCP and click New Session.
- In the Login window, enter the following information:
- File protocol: Amazon S3
- Host name: the endpoint without
https://, for examples3-hcm04.fptcloud.com - Port number:
443 - Access key ID: your Access Key
- Secret access key: your Secret Key
- Click Save to keep the session, then click Login. Your buckets appear in the WinSCP window, and you can drag and drop files to upload or download them.
s3sync
s3sync is an open-source command-line tool for fast, one-way synchronization between a local folder and a bucket, or between two buckets. It runs on Linux, macOS, FreeBSD, and OpenBSD.
Install s3sync
Download the build for your system from s3sync releases, then extract the archive.
Common options
| Option | Description |
|---|---|
--sk, --ss, --se, --sr | Access Key, Secret Key, endpoint, and region of the source. |
--tk, --ts, --te, --tr | Access Key, Secret Key, endpoint, and region of the target. |
-w | Number of parallel workers. |
--sync-progress | Show synchronization progress. |
--s3-acl | ACL for uploaded objects, such as private or public-read. |
--disable-http2 | Disable HTTP/2 for the client. |
--ratelimit-objects | Maximum objects per second. |
--ratelimit-bandwidth | Maximum bandwidth in bytes per second. Accepts suffixes K, M, G. |
--sr is required when the source is an Amazon S3 bucket outside us-east-1.
Examples
Replace YOUR_ACCESS_KEY, YOUR_SECRET_KEY, the endpoints, bucket names, and local paths with your own values.
Upload a local folder to a bucket:
./s3sync --tk YOUR_ACCESS_KEY --ts YOUR_SECRET_KEY --te https://s3-hcm04.fptcloud.com -w 64 fs:///path/to/local/folder/ s3://target-bucket/ --sync-progress --s3-acl private
Download a bucket to a local folder:
./s3sync --sk YOUR_ACCESS_KEY --ss YOUR_SECRET_KEY --se https://s3-hcm04.fptcloud.com -w 64 s3://source-bucket/ fs:///path/to/local/folder/ --sync-progress --disable-http2
Copy one bucket to another bucket in a different region:
./s3sync --sk YOUR_SOURCE_ACCESS_KEY --ss YOUR_SOURCE_SECRET_KEY --se https://s3-hcm04.fptcloud.com --tk YOUR_TARGET_ACCESS_KEY --ts YOUR_TARGET_SECRET_KEY --te https://s3-hfx03.fptcloud.com -w 64 s3://source-bucket/ s3://target-bucket/ --sync-progress --s3-acl private --disable-http2
Copy an Amazon S3 bucket to FPT Object Storage. Omit --se so that Amazon S3 is the source, and set --sr to the AWS region of the source bucket, for example ap-southeast-1:
./s3sync --sk YOUR_AWS_ACCESS_KEY --ss YOUR_AWS_SECRET_KEY --sr YOUR_AWS_REGION --tk YOUR_FPT_ACCESS_KEY --ts YOUR_FPT_SECRET_KEY --te https://s3-hcm04.fptcloud.com -w 64 s3://aws-source-bucket/ s3://fpt-target-bucket/ --sync-progress --s3-acl private --disable-http2
--s3-acl public-read makes every uploaded object readable by anyone on the Internet. Use it only for data that is meant to be public.