sudo systemctl restart systemd-timesyncd<\/code><\/pre>\n\n\n\nConfirm the status of status that it is now synchronized with the configured NTP server.<\/p>\n\n\n\n
systemctl status systemd-timesyncd<\/code><\/pre>\n\n\n\nOutput:<\/p>\n\n\n\n
\u25cf systemd-timesyncd.service - Network Time Synchronization\n Loaded: loaded (\/lib\/systemd\/system\/systemd-timesyncd.service; enabled; vendor preset: enabled)\n Active: active (running) since Sat 2022-05-14 12:10:14 UTC; 2s ago\n Docs: man:systemd-timesyncd.service(8)\n Main PID: 1166 (systemd-timesyn)\n Status: \"Initial synchronization to time server 192.168.59.38:123 (192.168.59.38).\"\n Tasks: 2 (limit: 2241)\n Memory: 1.2M\n CPU: 73ms\n CGroup: \/system.slice\/systemd-timesyncd.service\n \u2514\u25001166 \/lib\/systemd\/systemd-timesyncd\n\nMay 14 12:10:14 jellyfish systemd[1]: Starting Network Time Synchronization...\nMay 14 12:10:14 jellyfish systemd[1]: Started Network Time Synchronization.\nMay 14 12:10:14 jellyfish systemd-timesyncd[1166]: Initial synchronization to time server 192.168.59.38:123 (192.168.59.38).\n<\/code><\/pre>\n\n\n\ntimedatectl status<\/code><\/pre>\n\n\n\n Local time: Sat 2022-05-14 12:10:53 UTC\n Universal time: Sat 2022-05-14 12:10:53 UTC\n RTC time: Sat 2022-05-14 12:10:53\n Time zone: Etc\/UTC (UTC, +0000)\nSystem clock synchronized: yes\n NTP service: active\n RTC in local TZ: no\n<\/code><\/pre>\n\n\n\nUsing ntpdate<\/code> to Synchronize Client Systems’ Time<\/h3>\n\n\n\nOptionally the ntpdate<\/code> command can be used to manually synchronize client system time with NTP server. This guide uses Ubuntu 18.04 as the client.<\/p>\n\n\n\nInstall ntpdate<\/code> package, if not already installed.<\/p>\n\n\n\nsudo apt install ntpdate -y<\/code><\/pre>\n\n\n\nNOTE:<\/strong> Ensure that Client and NTP Server can communicate. You can use nc command to verify NTP server port connection.<\/p>\n\n\n\nFor example;<\/p>\n\n\n\n
nc -uvz 192.168.59.38 123<\/code><\/pre>\n\n\n\nSample output;<\/p>\n\n\n\n
Connection to 192.168.59.38 123 port [udp\/ntp] succeeded!<\/code><\/pre>\n\n\n\nNext, use ntpdate Command to Query Time Service. The ntpdate<\/code> command can be uses to query time service from an NTP server by running the command:<\/p>\n\n\n\nsudo ntpdate 192.168.59.38<\/code><\/pre>\n\n\n\nThe output shows the time offset between the two systems.<\/p>\n\n\n\n
14 May 12:17:28 ntpdate[1516]: adjust time server 192.168.59.38 offset -0.019108 sec<\/code><\/pre>\n\n\n\nSynchronize time Automatically Using NTP<\/h3>\n\n\n\n
NTP client can automatically be configured to query NTP server by using the NTPd daemon.<\/p>\n\n\n\n
Install NTP on Ubuntu\/Debian<\/p>\n\n\n\n
sudo apt install ntp -y<\/code><\/pre>\n\n\n\nThe installation of NTP will mask the systemd-timesyncd.service<\/code><\/strong>.<\/p>\n\n\n\nThe NTP service is set to run by default after installation. First check if the client is synchronized with NTP:<\/p>\n\n\n\n
timedatectl<\/code><\/pre>\n\n\n\nThe output will show if the system clock is synchronized or not. The output below clearly indicates time is not synced to any server.<\/p>\n\n\n\n
Local time: Sat 2022-05-14 12:20:04 UTC\n Universal time: Sat 2022-05-14 12:20:04 UTC\n RTC time: Sat 2022-05-14 12:20:04\n Time zone: Etc\/UTC (UTC, +0000)\nSystem clock synchronized: no\n NTP service: n\/a\n RTC in local TZ: no<\/code><\/pre>\n\n\n\nTo configure the NTP client to synchronize time from your NTP server, edit the ntp configuration file:<\/p>\n\n\n\n
sudo vim \/etc\/ntp.conf <\/code><\/pre>\n\n\n\nReplace public NTP pool servers with your server.<\/p>\n\n\n\n
#pool 0.ubuntu.pool.ntp.org iburst\n#pool 1.ubuntu.pool.ntp.org iburst\n#pool 2.ubuntu.pool.ntp.org iburst\n#pool 3.ubuntu.pool.ntp.org iburst\n\npool 192.168.59.38 iburst<\/code><\/pre>\n\n\n\nIdeally the server can be added without commenting out the default NTP servers by making it the preferred reference clock using the prefer<\/strong> option:<\/p>\n\n\n\npool 192.168.59.38 prefer iburst<\/code><\/pre>\n\n\n\nSave the configuration file and restart ntp.<\/p>\n\n\n\n
sudo systemctl restart ntp<\/code><\/pre>\n\n\n\nThe client is now successfully configured to sychronize system time with NTP server. This can be verified by running the command:<\/p>\n\n\n\n
ntpq -p<\/code><\/pre>\n\n\n\n remote refid st t when poll reach delay offset jitter\n==============================================================================\n 192.168.59.38 .POOL. 16 p - 64 0 0.000 +0.000 0.000\n ntp.ubuntu.com .POOL. 16 p - 64 0 0.000 +0.000 0.000\n*192.168.59.38 91.189.89.198 3 u 2 64 1 1.732 +16.240 0.089\n<\/strong> chilipepper.can 17.253.34.251 2 u 8 64 1 255.060 -41.243 0.000\n pugot.canonical 17.253.108.125 2 u 5 64 1 171.300 -0.021 0.000\n golem.canonical 134.71.66.21 2 u 4 64 1 263.212 -45.093 0.000\n alphyn.canonica 194.58.200.20 2 u 5 64 1 251.289 +2.991 0.000\n<\/code><\/pre>\n\n\n\nFrom the output we can see NTP server (192.168.56.103) as the time synchronization host\/source in the queue.<\/p>\n\n\n\n
Confirm NTP service is set to start at boot time:<\/p>\n\n\n\n
systemctl is-enabled ntp<\/code><\/pre>\n\n\n\nTo enable NTP service to start at boot time, just in case is not enabled, then you would run the command:<\/p>\n\n\n\n
systemctl enable ntp<\/code><\/pre>\n\n\n\nGreat, your NTP Clients should now be able to query the time services from your NTP Server.<\/p>\n\n\n\n
That brings us to the end of the guide on how install and setup NTP Client on Ubuntu\/Debian.<\/p>\n","protected":false},"excerpt":{"rendered":"
Follow through this tutorial to quickly learn how to install and configure NTP Client on Ubuntu\/Debian systems. Install and Configure NTP Client on Ubuntu\/Debian systems<\/p>\n","protected":false},"author":1,"featured_media":12756,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[5153,5152,5156,5154,5157,5155],"class_list":["post-12754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-install-ntp-client-on-debian","tag-install-ntp-client-on-ubuntu","tag-install-ntp-on-debian","tag-ntpdate-client-ubuntu","tag-synchronize-time-to-ntp","tag-systemd-timesyncd-service","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12754"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=12754"}],"version-history":[{"count":2,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12754\/revisions"}],"predecessor-version":[{"id":20514,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12754\/revisions\/20514"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12756"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=12754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=12754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=12754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}