Skip to main content

S3cmd

Overview​

S3cmd is a popular command-line tool for managing data in S3-compatible cloud storage services. It supports a wide range of operations, including uploading, downloading, syncing, and managing buckets and objects. S3cmd is available for Linux and macOS.

How to Connect S3cmd to Vietnix Cloud S3 Storage​

Follow these steps to configure S3cmd for Vietnix Cloud S3:

1. Install S3cmd​

  • On Linux:
    sudo apt-get install s3cmd
  • On macOS (with Homebrew):
    brew install s3cmd

2. Get Your Vietnix S3 Credentials​

You will need:

  • Access Key
  • Secret Key
  • Endpoint URL (e.g. https://s3.vn-hcm-1.vietnix.cloud)
  • Bucket Name

Find these details in your Vietnix Cloud Portal.

3. Configure S3cmd​

Run the following command to start configuration:

s3cmd --configure
  • Enter your Access Key and Secret Key.
  • For S3 Endpoint, enter your Vietnix S3 Endpoint URL (e.g. https://s3.vn-hcm-1.vietnix.cloud).
  • Set DNS-style bucket access to Yes.
  • Choose Signature Version 4 if prompted.
  • Save the configuration file when done.

Example Minimal Configuration​

Your .s3cfg file might look like:

[default]
access_key = YOUR_ACCESS_KEY
secret_key = YOUR_SECRET_KEY
host_base = s3.vn-hcm-1.vietnix.cloud
host_bucket = %(bucket)s.s3.vn-hcm-1.vietnix.cloud
signature_v2 = False
use_https = True

4. Test the Connection​

List buckets:

s3cmd ls

List objects in a bucket:

s3cmd ls s3://your-bucket-name

5. Common Operations​

  • Upload a file:
    s3cmd put ./local-file.txt s3://your-bucket-name/local-file.txt
  • Download a file:
    s3cmd get s3://your-bucket-name/remote-file.txt ./remote-file.txt
  • Sync a folder:
    s3cmd sync ./local-folder/ s3://your-bucket-name/

Refer to the S3cmd documentation for advanced usage and options.


note
  • Keep your credentials secure and rotate them regularly.
  • If you encounter issues, double-check your endpoint URL and credentials.
  • For advanced features and troubleshooting, see the S3cmd documentation.