Skip to main content

Access object storage (s3cmd)

To set up and use s3cmd on most Linux distributions, you can follow these steps:

  1. Install s3cmd: First, you need to install s3cmd. Depending on your Linux distribution, you can typically install it using the package manager.

    For example, on Ubuntu/Debian:

       sudo apt-get update
       sudo apt-get install s3cmd

    On CentOS/RHEL:

       sudo yum install s3cmd
  2. Configure s3cmd: After installation, you need to configure s3cmd with you credentials. Run:

       s3cmd --configure

    Follow the prompts to enter your Access Key, Secret Key, and preferred encryption settings.

  3. Test s3cmd: You can now test s3cmd by listing your buckets or performing other operations. For example:

       s3cmd ls

    This command will list all buckets associated with your AWS account.

  4. Usage: Now, you can start using s3cmd to interact with your S3 buckets. Here are a few common commands:

    • s3cmd ls s3://bucket-name: List objects in a bucket.

    • s3cmd put file.txt s3://bucket-name: Upload a file to a bucket.

    • s3cmd get s3://bucket-name/file.txt: Download a file from a bucket.

    • s3cmd mb s3://new-bucket: Create a new bucket.

    • s3cmd rb s3://bucket-name: Remove a bucket (make sure it's empty first).

Make sure to replace bucket-name with the name of your bucket and file.txt with the name of the file you want to upload/download. Remember to always be cautious when handling S3 credentials and data.