Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Object Storage
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Buckets
      • Creating a bucket
      • Deleting a bucket
      • Limiting the maximum size of a bucket
      • Allowing public access to a bucket
      • Bucket encryption
      • Managing object lifecycles
      • Managing CORS configurations
      • Editing a bucket ACL
      • Logging actions with the bucket
    • Objects
      • Uploading an object
      • Getting information about an object
      • Downloading an object
      • Getting a public link to an object
      • Deleting an object
      • Deleting a partially uploaded object
      • Editing an object ACL
    • Static website hosting
      • Hosting setup
      • Support for your own domain
      • Support for multiple domain names
      • Configuring HTTPS
  • Concepts
    • Overview
    • Bucket
    • Objects
    • Bucket versioning
    • Object lifecycles
    • CORS
    • Static website hosting
    • Pre-signed URLs
    • Multipart upload
    • Access control lists (ACLs)
    • Bucket Policy
    • Upload file via HTML form
    • Storage class
    • Logging actions with a bucket
    • Backups
    • TLS protocol
    • Quotas and limits
  • Tools
    • All tools
    • Console clients
      • AWS CLI
      • S3cmd
    • File browsers
      • CyberDuck
      • WinSCP
    • SDK
      • AWS SDK for Java
      • Python SDK (boto)
    • FUSE
      • s3fs
      • goofys
  • Amazon S3-compatible HTTP API
    • How to use the API
    • Signing requests
    • API reference
      • All services and methods
      • Bucket
        • All methods
        • create
        • getBucketEncryption
        • getMeta
        • listObjects
        • listBuckets
        • deleteBucket
        • deleteBucketEncryption
        • putBucketEncryption
        • putBucketVersioning
        • getBucketVersioning
        • putBucketLogging
        • getBucketLogging
        • listObjectVersions
      • Object
        • All methods
        • upload
        • get
        • copy
        • getObjectMeta
        • delete
        • deleteMultipleObjects
        • options
      • Multipart upload
        • General multipart upload procedure
        • startUpload
        • uploadPart
        • copyPart
        • listParts
        • abortUpload
        • completeUpload
        • listUploads
      • Static Website Hosting
        • All methods
        • upload
        • get
        • delete
        • Static website response codes
      • CORS
        • All methods
        • XML structure of CORS configuration
        • upload
        • get
        • delete
      • Lifecycles
        • All methods
        • XML structure of lifecycle configuration
        • upload
        • get
        • delete
      • ACL
        • All methods
        • XML structure of ACL configuration
        • objectGetAcl
        • objectPutAcl
        • bucketGetAcl
        • bucketPutAcl
      • Bucket Policy
        • All methods
        • GetBucketPolicy
        • PutBucketPolicy
        • DeleteBucketPolicy
        • Data schema
        • Actions
        • Conditions
      • Common request headers
      • Common response headers
      • Responses
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
  • Questions and answers
  1. Tools
  2. Console clients
  3. S3cmd

S3cmd

  • Before you start
  • Installation
  • Configuration
  • Specifics
  • Examples of operations
    • Getting a list of buckets
    • Creating a bucket
    • Uploading an object to cold storage
    • Getting a list of objects
    • Retrieving an object
    • Deleting an object

S3cmd is a console client (Linux, Mac) for services that support the Amazon S3 HTTP API. The general procedure for running commands is described in the official S3cmd documentation.

Before you start

  1. Create a service account.
  2. Assign a role to a service account.
  3. Create a static access key.

Installation

To learn how to download and install S3cmd, see the Download section on the official website of the project.

Configuration

To configure S3cmd, use the s3cmd --configure command. The command requests values for the following parameters:

  1. Access Key: Enter the ID of the key that you received when generating the static key.

  2. Secret Key: Enter the secret key that you received when generating the static key.

  3. Default Region: Enter ru-central1.

    Note

    Always specify the ru-central1 region when accessing Object Storage. A different region value may lead to an authorization error.

  4. S3 Endpoint: Enter storage.yandexcloud.net.

  5. DNS-style bucket+hostname:port template for accessing a bucket: Enter %(bucket)s.storage.yandexcloud.net.

  6. Leave the other parameter values unchanged.

The client tries to establish a connection with Object Storage and get a list of buckets. If successful, it will return Success. Your access key and secret key worked fine :-).

The s3cmd --configure command saves the settings to a ~/.s3cfg file in the format:

[default]
access_key = id
secret_key = secretKey
bucket_location = ru-central1
host_base = storage.yandexcloud.net
host_bucket = %(bucket)s.storage.yandexcloud.net

If necessary, you can change these settings directly in the file. You can also specify settings when launching the client by using the appropriate parameters.

For the static website hosting control commands to work correctly, manually add the following parameter to the configuration file:

website_endpoint = http://%(bucket)s.website.yandexcloud.net

Specifics

  • S3cmd treats Object Storage as a hierarchical file system and object keys look like file paths.
  • By default, S3cmd uploads objects to cold storage. To specify the storage class when uploading an object, use the --storage-class key.

Examples of operations

Note

To enable debug output in the console, use the --debug key.

Getting a list of buckets

s3cmd ls

Creating a bucket

s3cmd mb s3://bucket

Note

When creating a bucket, follow the naming conventions.

Uploading an object to cold storage

s3cmd --storage-class COLD put local_file s3://bucket/object

Getting a list of objects

s3cmd ls s3://bucket

Retrieving an object

s3cmd get s3://bucket/object local_file

Deleting an object

s3cmd del s3://bucket/object
In this article:
  • Before you start
  • Installation
  • Configuration
  • Specifics
  • Examples of operations
  • Getting a list of buckets
  • Creating a bucket
  • Uploading an object to cold storage
  • Getting a list of objects
  • Retrieving an object
  • Deleting an object
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC