Test access to S3 objects using curl command
To validate the accessibility of an S3 object from a different host, follow the steps below:
Get the S3 access key and secret key (SSH to the Master server):
cd $install_dir/minio/data/.minio.sys/config head -n10 config.jsonConnect to the APP, ML, BEP servers and test the accessibility of an S3 object.
Get the current date for the signature:
date +%Y%m%dT%H%M%SZCreate a string to sign:
string="GET\n\n\n20191115T122644Z\n/doc-upload/fe8d4a4a-a0de-4155-afbf-eb814afc878c.pdf"where:
20191115T122644Zis the output of thedate +%Y%m%dT%H%M%SZcommand./doc-uploadis the bucket name./fe8d4a4a-a0de-4155-afbf-eb814afc878c.pdfis the object (file) location and file name.
Create a request signature for S3:
echo -en ${string} | openssl sha1 -hmac input_your_s3-secret-key -binary | base64 Output: R3zIttg4p/xRWQO8WAsGIfj757M=- 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