Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How To Setup NTP Server on Ubuntu & LinuxMint

    How To Setup NTP Server on Ubuntu & LinuxMint

    RahulBy RahulSeptember 3, 20152 Mins ReadUpdated:August 3, 2018

    For System Administrator managing the huge number of systems on their LAN. It is best practice to set up your own NTP server and synchronize the time of all LAN system from it. Main NTP server will synchronize its time from public NTP servers. This article will help you to Setup time synchronization (NTP) server on Ubuntu, Debian, and its derivatives operating systems.

    Step 1 – Install NTP Server

    You can simply install the ntpd server from default repositories by executing the following command from terminal.

    sudo apt-get install ntp
    

    Step 2 – Configure NTP Server

    Now we need to set up local NTP server to synchronize their time from public NTP server. You can choose ntp pool server as per your choice or location. Visit pool.ntp.org to find ntp pool. For this example, I am using default Ubuntu’s ntp pool servers.

    sudo vi /etc/ntp.conf
    

    Edit /etc/ntp.conf and change following pools as per your choice. By default these servers are configured:

    # Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
    # on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
    # more information.
    
    server 0.ubuntu.pool.ntp.org
    server 1.ubuntu.pool.ntp.org
    server 2.ubuntu.pool.ntp.org
    server 3.ubuntu.pool.ntp.org
    

    Step 3 – Reload NTP Server

    After making changes in ntp.conf, reload your server to apply changes.

    sudo service ntp reload
    

    Step 4 – Open Firewall Ports

    NTP server uses port 123 for service requests. So we need to open port 123 in the firewall.

    Iptables Users:

    sudo iptables -A INPUT -m state --state NEW -p tcp --dport 123 -j ACCEPT
    

    UFW Users:

    sudo ufw allow 123/tcp
    

    Step 5 – Synchronize Time on Client

    After making all configuration’s, now verify server configuration by synchronizing client systems. For example, if your server IP is 192.168.1.100, then run the following command through a terminal on the client system.

    ntpdate -s 192.168.1.100
    
    ntp ntpd ntpdate time
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install LAMP (PHP 5.5, Apache 2.4 and MySQL 5.5) on Ubuntu 14.04 (Trusty Tahr)
    Next Article How To Setup A Firewall with UFW on Ubuntu & Debian

    Related Posts

    What is the /etc/aliases file

    2 Mins Read

    What is the /etc/nsswitch.conf file in Linux

    2 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    How to Delete a Let’s Encrypt Certificate using Certbot

    Updated:June 3, 20222 Mins Read

    How to Install Latest Git on Ubuntu 22.04

    Updated:May 31, 20222 Mins Read

    How To Install LibreOffice on Ubuntu 22.04

    Updated:May 23, 20222 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.