How does linux gets it's time?
- While booting, the system gets its time from the hardware clock
- System time is set next, according to the hardware clock
- Internet time can be used to synchronize time
commands involved in managing time
hwclock
is used to set hardware time- Also use it to synchronize time
hwclock --systohc
hwclock --hctosys
date
is used to show and set timetimedatectl
is used to manage time and time zone configuration
Commands involved in managing linux time
NTP
Info
- NTP (Network Time Protocol) is a protocol used to synchronize the clocks of computers and other devices over a network
chronyd
is the default RHEL 9 NTP service
3 parameters
Remember
Use /etc/chrony.conf to specify synchronization parameters
- pool 2.rhel.pool.ntp.org iburst configures a pool of NTP servers
- server myserver.example.com configures a single NTP time source
Use iburst to permit fast synchronization
After modifying its contents, use systemctl restart chronyd to restart the chronyd service
Use chronyc sources to verify proper synchronization
- make sure NTP service is active
yum install chrony
vim /etc/chrony.conf
difference_between_server_and_pool
systemctl restart chronyd
chronyc sources
timedatectl
timedatectl set-ntp true