S3cmd
S3cmd
Before you start
- Create a service account.
- Add the service account to a group to grant it necessary permissions.
- Create a static access key.
Installation
To learn how to download and install S3cmd, see the Download
Setup
To configure S3cmd, use the s3cmd --configure
command. For a query, specify values for the following parameters:
-
Access Key
: Enter the ID of the key that you received when generating the static key. -
Secret Key
: Enter the secret key that you received when generating the static key. -
Default Region
: Entereu-north1
.Note
To work with Object Storage, always specify
eu-north1
as the region. A different region value may lead to an authorization error. -
S3 Endpoint
: Enterstorage.ai.nebius.cloud
. -
DNS-style bucket+hostname:port template for accessing a bucket
: Enter%(bucket)s.storage.ai.nebius.cloud
. -
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 = eu-north1
host_base = storage.ai.nebius.cloud
host_bucket = %(bucket)s.storage.ai.nebius.cloud
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.
Specifics
- S3cmd treats Object Storage as a hierarchical file system and object keys look like file paths.
- By default, when uploading an object, S3cmd can send the additional header
X-Amz-Meta-S3cmd-Attrs
with the attributes of your file (access rights, file owners, timestamps). The header value is saved in the metadata of the object. You can disable the sending of attributes using thepreserve_attrs = False
parameter in the configuration file~/.s3cfg
or using the--no-preserve
key.
Operation examples
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.
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