Snippets

Jonathan Hult Linux - chrony - sync time to NTP

Created by Jonathan Hult last modified
#!/bin/bash

# Install
sudo apt install chrony

# Edit server to sync with
sudo nano /etc/chrony/chrony.conf

# Put at top of file and comment out others
# This IP is only for AWS - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html
server 169.254.169.123 prefer iburst

# Start service and enable on boot
sudo systemctl start chrony
sudo systemctl enable chrony

# Set timezone
sudo dpkg-reconfigure tzdata

# Verify
chronyc tracking
timedatectl

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.