I installed the ec2 api following the amazon guide. I setted up the access id and secret as environment variable.
Here it is my profile:
expor
Run aws s3 ls to confirm whether the error is related to time sync. You should get the error like:
An error occurred (RequestTimeTooSkewed) when calling the ListBuckets operation: The difference between the request time and the current time is too large.
If so, try to sync your datetime as suggested.
Example shell commands on Linux to do that:
# Install the ntpdate client for setting system time from NTP servers.
sudo apt-get --yes install ntpdate
sudo ntpdate 0.amazon.pool.ntp.org
Then re-try your aws command again.
If the timezone is still not correct, run: sudo dpkg-reconfigure tzdata to configure it, or by:
timedatectl list-timezones
timedatectl set-timezone 'Europe/London'
See also: Configure localtime. dpkg-reconfigure tzdata.