Skip to main content
Version: 10.2.9

Test access to S3 objects using curl command

To validate the accessibility of an S3 object from a different host, follow the steps below:

  1. Get the S3 access key and secret key (SSH to the Master server):

    cd $install_dir/minio/data/.minio.sys/config
    head -n10 config.json
  2. Connect to the APP, ML, BEP servers and test the accessibility of an S3 object.

    1. Get the current date for the signature:

      date +%Y%m%dT%H%M%SZ
    2. Create a string to sign:

      string="GET\n\n\n20191115T122644Z\n/doc-upload/fe8d4a4a-a0de-4155-afbf-eb814afc878c.pdf"

      where:

      • 20191115T122644Z is the output of the date +%Y%m%dT%H%M%SZ command.
      • /doc-upload is the bucket name.
      • /fe8d4a4a-a0de-4155-afbf-eb814afc878c.pdf is the object (file) location and filename.
    3. Create a request signature for S3:

      echo -en ${string} | openssl sha1 -hmac input_your_s3-secret-key -binary | base64
      Output: R3zIttg4p/xRWQO8WAsGIfj757M=
    4. Use the curl command to get the object (file) from the S3 bucket:

      curl -v -k -H "Host: input_s3-server_hostname" -H "Date: input_date_from_step1" -H "Authorization: AWS input_your_s3-access-key:R3zIttg4p/xRWQO8WAsGIfj757M=" "https://input_s3-server_hostname/doc-upload/fe8d4a4a-a0de-4155-afbf-eb814afc878c.pdf" | less