When I am trying to access S3 service from EC2 , getting Access Denied errors for different operations like create bucket, list bucket, list objects etc. I have not changed the unix user password. Even with the root user, I am unable to access the S3 service.
1] Command - aws s3 ls
Error : An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied
2] Command - aws s3 ls htcdsb-dev
Error : An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied
Above errors are getting for normal unix user. For the root user below errors are getting generated.
1] Command - aws s3 ls
Error : An error occurred (AuthorizationHeaderMalformed) when calling the ListBuckets operation: The authorization header is malformed; the authorization component "Credential=AWSAccessKeyId=A******************Q/20171122/us-east-1/s3/aws4_request" is malformed
(I have purposely put asterisk(*) here to hide my access key). Except S3, I am able to access other services like IAM and AWS Glue.
I am unable to understand why the issue is occurring. Also I am unable to understand the link the between the Unix user and the AWS S3 operations.
I have created IAM role, also run AWS configure and Reboot EC2 instance but also having same issue.
IAM Role:
HT_EC2_User
Content of AWS config file:
cat .aws/config
[default]
region = us-east-1
output = None
aws configure
(these are saved separately per unix user). (Also, that one AWS user may not have permissions to access the specific bucket(s)) – Dusan Bajic