User in an EC2 instance that’s assigned a S3 full access role can’t access S3

545 views Asked by At

The EC2 instance has an IAM role assigned to it allowing it the full access to S3. I think this would allow any user in that instance to access S3, like issuing command aws s3 ls. But it turns out that only the default ec2-user and root(using sudo) are allowed. What should I do to grant any user in the instance to access S3 without having to use sudo?

1

There are 1 answers

0
Mandeep Rana On

I am facing the same issue and resolved by doing below steps. First i have checked the ~/.aws/credentials file on both user. /home/ec2-user/.aws/credentials /root/.aws/credentials

now i have commented the aws key and secret key in /root/.aws/credentials

like this.

[default]
#aws_access_key_id = youraws key
#aws_secret_access_key = your secrete key

this is all because root user is using the different access keys to access the aws resources.