Installation

See https://aws.amazon.com/cli/

On mac or linux: pip install awscli

Configuration

Configure for AWS. The key values do not matter.

  1. $ aws configure
  2. AWS Access Key ID [None]: any
  3. AWS Secret Access Key [None]: any
  4. Default region name [None]: us-east-1
  5. Default output format [None]:

Also, make sure using AWS signature version 4:

  1. $ aws configure set default.s3.signature_version s3v4

Execute commands

  1. # list buckets
  2. $ aws --endpoint-url http://localhost:8333 s3 ls
  3. 2019-01-02 01:59:25 newbucket
  4. # list files inside the bucket
  5. $ aws --endpoint-url http://localhost:8333 s3 ls s3://newbucket
  6. 2019-01-02 12:52:44 6804 password
  7. # make a bucket
  8. $ aws --endpoint-url http://localhost:8333 s3 mb s3://newbucket3
  9. make_bucket: newbucket3
  10. # add an object
  11. $ aws --endpoint-url http://localhost:8333 s3 cp /etc/passwd s3://newbucket3
  12. upload: ../../../../../etc/passwd to s3://newbucket3/passwd
  13. # copy an object
  14. $ aws --endpoint-url http://localhost:8333 s3 cp s3://newbucket3/passwd s3://newbucket3/passwd.txt
  15. copy: s3://newbucket3/passwd to s3://newbucket3/passwd.txt
  16. # remove an object
  17. $ aws --endpoint-url http://localhost:8333 s3 rm s3://newbucket3/passd
  18. delete: s3://newbucket3/passd
  19. # remove a bucket
  20. $ aws --endpoint-url http://localhost:8333 s3 rb s3://newbucket3
  21. remove_bucket: newbucket3