Linux Networking & TCP/IP for Developers · Lezione

NTP e servizi di sincronizzazione dell’ora

Mantenga accurati gli orologi Linux con NTP usando chrony e timedatectl e comprenda perché l’ora sincronizzata sia fondamentale per i servizi in rete.

Lezione 4 di 413 passaggi

NTP e servizi di sincronizzazione dell’ora è una lezione Linux Networking & TCP/IP for Developers gratuita su CoddyKit. Questa è la lezione 4 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Linux Networking & TCP/IP for Developers, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Linux Networking & TCP/IP for Developers include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

Why Time Matters

Accurate clocks are essential for networked systems. Logs, TLS certificates, authentication tokens, and distributed databases all break when clocks drift apart. The Network Time Protocol (NTP) keeps them aligned.

How NTP Works

NTP clients query time servers, measure the network round-trip, and gradually adjust the local clock. It corrects for delay so even over the internet machines stay within milliseconds.

Stratum Levels

NTP servers are ranked by stratum. Stratum 0 is a reference clock (like GPS), stratum 1 servers connect directly to it, and each layer below is one step further. Lower stratum means closer to the source.

Checking Time Status

The simplest check is timedatectl, which shows the current time, timezone, and whether NTP synchronization is active.

timedatectl status

Enabling NTP

Turn on automatic synchronization with one command. The system then keeps the clock in sync in the background.

sudo timedatectl set-ntp true

Meet chrony

chrony is the modern NTP implementation used by most Linux distributions. It handles intermittent connections and large time jumps better than the older ntpd.

sudo systemctl status chronyd

Viewing Sources

List the time servers chrony is using and how it rates them with chronyc sources. The asterisk marks the currently selected source.

chronyc sources -v

Measuring Accuracy

chronyc tracking shows how far off the clock is and how it is being corrected, including the estimated offset from true time.

chronyc tracking

Configuring Servers

Edit /etc/chrony/chrony.conf to point at preferred pools or internal time servers, then restart the service. Many setups use the public NTP pool.

pool pool.ntp.org iburst

Timezone vs Clock

Time synchronization sets the absolute moment (UTC), while the timezone affects how it is displayed. Set the zone separately and keep the hardware clock in UTC.

sudo timedatectl set-timezone Europe/Istanbul

Forcing a Sync

After a long downtime the clock may be far off. chronyc makestep forces an immediate correction instead of slowly slewing, useful right after boot.

sudo chronyc makestep

Quick Check

Test your NTP knowledge.

Recap

You learned to manage time synchronization.

  • NTP keeps clocks aligned, which is critical for logs, TLS, and auth.
  • Use timedatectl to check and enable sync; chrony is the modern daemon.
  • chronyc sources and tracking show servers and accuracy.
Gratis per iniziare

Impara Linux Networking & TCP/IP for Developers con un tutor IA — gratis

Scrivi ed esegui vero codice nel tuo browser, ricevi aiuto istantaneo da un tutor IA disponibile 24/7, e riprendi da dove hai lasciato sul web o nell'app.

Corsi
12
Lezioni
48

Domande Frequenti

La lezione «NTP e servizi di sincronizzazione dell’ora» è gratuita?

Sì — il testo completo di «NTP e servizi di sincronizzazione dell’ora» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Linux Networking & TCP/IP for Developers, passa a CoddyKit PRO. Il corso Linux Networking & TCP/IP for Developers include 4 lezioni in totale.

Cosa imparerò in «NTP e servizi di sincronizzazione dell’ora»?

Mantenga accurati gli orologi Linux con NTP usando chrony e timedatectl e comprenda perché l’ora sincronizzata sia fondamentale per i servizi in rete. Eserciti Linux Networking & TCP/IP for Developers con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Linux Networking & TCP/IP for Developers?

Non è richiesta alcuna esperienza precedente. Linux Networking & TCP/IP for Developers su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 4 di 4.

Quanto tempo richiede la lezione «NTP e servizi di sincronizzazione dell’ora»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Linux Networking & TCP/IP for Developers?

Sì. Ogni lezione Linux Networking & TCP/IP for Developers include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. SSH per l’accesso remoto sicuro
  2. Servizi web HTTP/HTTPS
  3. Servizi DHCP e DNS
  4. NTP e servizi di sincronizzazione dell’ora
← Torna a Linux Networking & TCP/IP for Developers