Linux Networking & TCP/IP for Developers · درس

خدمات NTP ومزامنة الوقت

حافظ على دقة ساعات Linux باستخدام NTP مع chrony وtimedatectl، وافهم سبب أهمية الوقت المتزامن للخدمات المتصلة بالشبكة.

الدرس 4 من 413 خطوة

خدمات NTP ومزامنة الوقت درس مجاني في Linux Networking & TCP/IP for Developers على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Linux Networking & TCP/IP for Developers، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Linux Networking & TCP/IP for Developers 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

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.
البدء مجانًا

تعلم Linux Networking & TCP/IP for Developers مع معلم ذكاء اصطناعي — مجانًا

اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.

الدورات
12
الدروس
48

الأسئلة الشائعة

هل درس «خدمات NTP ومزامنة الوقت» مجاني؟

نعم — نص درس «خدمات NTP ومزامنة الوقت» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Linux Networking & TCP/IP for Developers، انتقل إلى CoddyKit PRO. تتضمن دورة Linux Networking & TCP/IP for Developers 4 دروس في المجموع.

ماذا ستتعلم في «خدمات NTP ومزامنة الوقت»؟

حافظ على دقة ساعات Linux باستخدام NTP مع chrony وtimedatectl، وافهم سبب أهمية الوقت المتزامن للخدمات المتصلة بالشبكة. تتمرن على Linux Networking & TCP/IP for Developers مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Linux Networking & TCP/IP for Developers؟

لا تُشترط خبرة سابقة. Linux Networking & TCP/IP for Developers على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «خدمات NTP ومزامنة الوقت»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Linux Networking & TCP/IP for Developers هذا؟

نعم. كل درس في Linux Networking & TCP/IP for Developers يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. SSH للوصول البعيد الآمن
  2. خدمات الويب HTTP/HTTPS
  3. خدمات DHCP وDNS
  4. خدمات NTP ومزامنة الوقت
← العودة إلى Linux Networking & TCP/IP for Developers