RHEL Time Protocols

This is a quick and dirty cheatsheet on both the old NTP and the newer Chrony time protocols.

NTP

I am presuming that NTP is being used by RHEL6 and thus some of the command (starting/stopping) use the old RHEL 6 services, chkconfig, etc, if not then subsitute for the newer systemctl command.

files and directories
/etc/ntp.conf
/etc/ntp
daemons
ntpd
configuration
chkconfig ntpd on             # runlevel 2,3,4 and 5
chkconfig --list ntpd

edit /etc/ntp.conf
starting/stopping/status
service ntpd start
service ntpd stop
service ntpd status
displaying
ntpq -p
ntptime
ntpdate
ntpstat
ntpdc             # NTP commandline console
firewall
iptables -A OUTPUT -p udp --dport 123 -j ACCEPT
iptables -A INPUT -p udp --sport 123 -j ACCEPT

Chrony

I am presuming that Chrony is being used by RHEL 7 and 8 and thus some of the command (starting/stopping) use the newer systemctl command.

files and directories
/etc/chrony.conf
/etc/chrony.key
daemons
chronyd
configuration
edit /etc/chrony.conf

systemctl enable chronyd
systemctl disable chronyd
starting/stopping/status
systemctl start chronyd
systemctl stop chronyd
systemctl status chronyd
displaying
chronyc sources [-v]
chronyc tracking
chronyc sourcestats
firewall
firewall-cmd --permanent --zone=public --add-port=123/udp