[CENTOS] NTP configuration memo on Linux

I tried setting NTP on CentOS 7

This time, I tried to set NTP, so I will write it in a memo as a memorandum. I'm sure there are other people listed, but it's not bad. ..

First of all, from the general flow.

  1. Install NTP service
  2. Enter the settings in the ntp.conf file
  3. Set the time with the ntpupdate command
  4. Start the ntpd service

Now, let's actually describe the details of each.

1. Install NTP service

2. Enter the settings in the ntp.conf file

The configuration file for ntp.conf is below. /etc/ntp.conf

2-1. First, make a backup of ntp.conf.

cp -p /etc/ntp.conf /etc/Backup file name (optional).conf



2-2.
 Next, edit the ntp.conf file.

#### **`vi /etc/ntp.conf`**
```conf


 The following contents are described in the contents of the ntp.conf file, so comment them out with "#".
 Describe the information of the NTP server you want to set on it.
 * This time, as an example, NICT (http://jjy.nict.go.jp/ntp/)
 NTP server and MULTIFEED (https://www.mfeed.ad.jp/ntp/overview.html)
 The NTP server of is described.
>server 0.centos.pool.ntp.org iburst
>server 1.centos.pool.ntp.org iburst
>server 2.centos.pool.ntp.org iburst
>server 3.centos.pool.ntp.org iburst

↓↓↓
>  server ntp.nict.jp
>  server ntp1.jst.mfeed.ad.jp
>  #server 0.centos.pool.ntp.org iburst
>  #server 1.centos.pool.ntp.org iburst
>  #server 2.centos.pool.ntp.org iburst
>  #server 3.centos.pool.ntp.org iburst

### 3. Set the time with the ntpupdate command
 * If the time is off, synchronization will not be successful, so perform this procedure.
 Execute the following command.
```date```
```ntpupdate ntp server```
```date```
 There is a possibility that the time is off on the first date, but the time is correct on the second date after executing ntpupdate.

### 4. Start the ntpd service
 Execute the following command to restart the NTP service.
```service ntpd restart```

 Make sure the NTP service is running.
```service ntpd status```


Recommended Posts

NTP configuration memo on Linux
Linux x memo
linux (ubuntu) memo
React → Ajax → Django on Linux implementation memo
Linux # Command Memo 1
Daemonizing processes on Linux
[Linux] Volume configuration command
jblas on Arch Linux
Linux standard textbook memo 1
Linux standard textbook memo 3
Linux (WSL) on Windows
NAT router on Linux
[For memo] Linux Part 2
Develop .NET on Linux
Wake on lan on Linux
Monitor traffic on Linux
Update vscode on linux
Try NeosVR on Linux
manjaro linux configuration memorandum
Check capacity on Linux
LiveUSB creation on Linux
Linux operation on Win10
Install Minecraft on Arch Linux
A memo on how to easily prepare a Linux exercise environment
Install Linux on your Chromebox
Downgrade Mcomix on Arch Linux
Monitor disk usage on Linux
Linux standard textbook memo 1 part 2
Use Github Desktop on Linux
Install the JDK on Linux
Elixir = Comfortable on Linux Mint
Recording and playback on Linux
Check TTL on Linux router
Read core voltage on Linux
Put jenv on Amazon Linux
Easy df command on Linux
Linux on Windows -1-: debian introduction
Install tomcat 5.5 on Amazon Linux.
Introducing Elixir on Linux Mint
Linux tar xz command memo
Memo on Mac OS X
Use sshpass on Amazon linux2
Memo of Linux environment construction using VirtualBox + Vagrant on Windows 10
Install Homebrew on Amazon Linux 2
Paste the link on linux
Install strongSwan 5.9.1 on Amazon Linux 2
Linux environment construction (on WSL environment)
Run FreeBSD on Linux + qemu
Use Linux on Windows 10 (WSL2)
Linux standard textbook memo part 6
Setting up OpenSSH on Arch Linux
Use host.docker.internal on linux (docker-compose required)
Install Python Pillow on Amazon Linux
Python environment construction memo on Windows 10
Easy copy to clipboard on Linux
Install oracle java8 on amazon linux2
Linux Frequently Used Commands [Personal Memo]
[For memo] Linux Part 1 vi editor
Try installing OpenAM on Amazon Linux
Install ghoto2 on Raspberry Pi (memo)
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)