GNU/Linux >> Linux Esercitazione >  >> Cent OS

Comando ntpstat Mostra non sincronizzato (CentOS/RHEL)

L'output del comando ntpstat mostra "non sincronizzato":

# ntpstat 
unsynchronised
time server re-starting

L'output del comando "ntpq -p" mostra che nessuno dei server ntp è stato scelto:

# ntpq -p
==========================================
   remote           refid      st t when poll reach   delay   offset  jitter
===============================================
ntp-server   .INIT.          16 u    -   16    0    0.000    0.000   0.000
ntp-server   .INIT.          16 u    -   16    0    0.000    0.000   0.000

L'output del comando as mostra che entrambi i server ntp sono stati rifiutati:

# ntpq> as
ind assID status conf reach auth condition last_event cnt
===========================================================
1 54459 8000 yes yes none reject
2 54460 8000 yes yes none reject

L'output del comando rv mostra che entrambi i server ntp sono nello stato "non raggiungibile":

# ntpq> rv 54459
assID=54459 status=8000 unreach, conf, no events,
srcadr=, srcport=123, dstadr=x.x.x.x, dstport=123, leap=11,
..........
# ntpq> rv 54460
assID=54460 status=8000 unreach, conf, no events,
srcadr=, srcport=123, dstadr=x.x.x.x, dstport=123, leap=11,
..........

La soluzione

"Limita predefinito ignora ” nel file di configurazione ntp impedisce l'accesso dal server ntp remoto. Il file di configurazione ntp è il seguente:

# cat /etc/ntp.conf
restrict default kod nomodify notrap nopeer noquery ignore
restrict -6 default kod nomodify notrap nopeer noquery ignore
...

"restrict default ignore" impedirà l'accesso non solo da tutti i client ma anche da tutti i server ntp remoti.

Soluzione 1

1. Modifica /etc/ntp.conf e modificare la configurazione per consentire l'accesso illimitato da tutte le macchine:

Cambia da:

restrict default kod nomodify notrap nopeer noquery ignore
restrict -6 default kod nomodify notrap nopeer noquery ignore

A

restrict default
restrict -6 default

2. Riavvia il servizio ntpd:

# service ntpd restart

3. Attendi qualche minuto, quindi esegui "ntpq -p" per verificare se funziona.

Soluzione 2

1. Modifica /etc/ntp.conf e modificare la configurazione per consentire l'accesso illimitato da un server ntp specifico:

Cambia da:

restrict default kod nomodify notrap nopeer noquery ignore
restrict -6 default kod nomodify notrap nopeer noquery ignore

A

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict xxx.xxx.xxx.xxx (IP address of a specific ntp server)

2. Riavvia il servizio ntpd:

# service ntpd restart

3. Attendi qualche minuto, quindi esegui "ntpq -p" per verificare se funziona.


Cent OS
  1. Modifica il runlevel predefinito in CentOS 7 / RHEL 7

  2. comando semanage non trovato in CentOS 8 / RHEL 8

  3. comando ifconfig non trovato – CentOS/RHEL 7

  4. Come modificare la porta predefinita di Apache su RHEL/CentOS 7

  5. "-bash:route:comando non trovato" su CentOS/RHEL 7

Come scaricare RPM senza installarlo su RHEL 8 / CentOS 8

26 Esempi di comandi DNF in Fedora / CentOS / RHEL

Installa KVM (QEMU) su CentOS 7 / RHEL 7

netstat Comando non trovato su CentOS 8 / RHEL 8 – Correzione rapida

Come installare Scala 3 su RHEL 8 / CentOS 8

Esempi di comandi KVM Virsh su CentOS e RHEL