Skip to content

Instantly share code, notes, and snippets.

@tobernguyen
Last active March 24, 2021 22:56
Show Gist options
  • Save tobernguyen/8fd51c2ff44adec449529a765555cfaa to your computer and use it in GitHub Desktop.
Save tobernguyen/8fd51c2ff44adec449529a765555cfaa to your computer and use it in GitHub Desktop.
Setup Amazon Time Sync on Ubuntu EC2
#!/bin/bash
set -xe
# Install Chrony and use Amazon Time Sync Service
sudo apt install chrony -y
sudo sed -i '1s;^;server 169.254.169.123 prefer iburst minpoll 4 maxpoll 4\n;' /etc/chrony/chrony.conf
sudo /etc/init.d/chrony restart
# For install verification
sleep 5
chronyc sources -v
chronyc tracking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment