Fixing Authorization Failure in Ubuntu VM AWS CLI by Synchronizing the Clock

Hits: 1327

AWS EC2 CLI “AWS was not able to validate the provided access credentials”

I am just trying to run my aws cli from a VM that I keep on a disk-on-key. I added the credentials several times, even creating new accounts. After a few hours of growing perturbance add desire for violence.

Running simple awscli commands worked, like

aws sts get-caller-identity


aws iam list-access-keys

but the more important

aws ec2 describe instances

kept giving a horrible error.

An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials

Apparently this is caused by not installing ntp client. In my previous job going nuts about ntp was a daily occurrance, because Openstack and Openshift always refuse to work without it properly set up, usually within the private cloud. But I hadn’t yet seen AWS act in this way.

Well all you need to do is to install ntpdate

I did

apt install ntp ntpdate -y

then it pretty much miraculously gave me my coveted list of instances.

sudo ntpdate