s3cmd is yet another Python client for S3 storage management. It can be installed with pip install s3cmd and configured very easily.

It is sufficient to run s3cmd --configure and type the requested info:


[ffornari@tb-cloud-ui ~]$ s3cmd --configure

Enter new values or accept defaults in brackets with Enter.

Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.

Access Key: XXX

Secret Key: XXX

Default Region [US]: tier1

Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3.

S3 Endpoint [s3.amazonaws.com]: tb-cloud-api-pub.cr.cnaf.infn.it:8080

Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used

if the target S3 system supports dns based buckets.

DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)s.s3.amazonaws.com]: 

Encryption password is used to protect your files from reading

by unauthorized persons while in transfer to S3

Encryption password: XXX

Path to GPG program [/usr/bin/gpg]: 

When using secure HTTPS protocol all communication with Amazon S3

servers is protected from 3rd party eavesdropping. This method is

slower than plain HTTP, and can only be proxied with Python 2.7 or newer

Use HTTPS protocol [Yes]:

On some networks all internet access must go through a HTTP proxy.

Try setting it here if you can't connect to S3 directly

HTTP Proxy server name: 

New settings:

  Access Key: ffornariS3

  Secret Key: XXX

  Default Region: tier1

  S3 Endpoint: tb-cloud-api-pub.cr.cnaf.infn.it:8080

  DNS-style bucket+hostname:port template for accessing a bucket: test

  Encryption password: XXX

  Path to GPG program: /usr/bin/gpg

  Use HTTPS protocol: True

  HTTP Proxy server name: 

  HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] Y

Please wait, attempting to list all buckets...

WARNING: Retrying failed request: /?delimiter=%2F ('')

WARNING: Waiting 3 sec...

Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...

Success. Encryption and decryption worked fine :-)

Save settings? [y/N] y

Configuration saved to '/home/ffornari/.s3cfg'

[ffornari@tb-cloud-ui ~]$


Then you'll be able to manage your buckets and objects:


(NG-ffornari-tier1) [ffornari@tb-cloud-ui ~]# s3cmd --signature-v2 ls

2009-02-03 16:45  s3://pippo

(NG-ffornari-tier1) [ffornari@tb-cloud-ui ~]# s3cmd --signature-v2 ls s3://pippo

2020-07-02 10:17         6   s3://pippo/pippo.txt

(NG-ffornari-tier1) [ffornari@tb-cloud-ui ~]# 


Very important: remember to specify signature version v2 with --signature-v2.

  • No labels