GNU/Linux >> Znalost Linux >  >> Cent OS

Příkaz ntpstat Zobrazí nesynchronizovaný (CentOS/RHEL)

Výstup příkazu ntpstat zobrazuje „unsynchronised“:

# ntpstat 
unsynchronised
time server re-starting

Výstup příkazu „ntpq -p“ ukazuje, že není vybrán žádný z ntp serverů:

# 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

Výstup příkazu as ukazuje, že oba servery ntp byly odmítnuty:

# 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

Výstup příkazu rv ukazuje, že oba ntp servery jsou ve stavu „unreach“:

# 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,
..........

Řešení

omezit výchozí ignorování ” v konfiguračním souboru ntp brání přístupu ze vzdáleného serveru ntp. Konfigurační soubor ntp je následující:

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

„restrict default ignore“ zabrání přístupu nejen ze všech klientů, ale také ze všech vzdálených ntp serverů.

Řešení 1

1. Upravte /etc/ntp.conf a upravte konfiguraci tak, aby umožňovala neomezený přístup ze všech počítačů:

Změnit z:

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

Komu

restrict default
restrict -6 default

2. Restartujte službu ntpd:

# service ntpd restart

3. Počkejte několik minut a poté spusťte „ntpq -p“ a zkontrolujte, zda to funguje.

Řešení 2

1. Upravte /etc/ntp.conf a upravte konfiguraci tak, aby umožňovala neomezený přístup z konkrétního serveru ntp:

Změnit z:

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

Komu

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. Restartujte službu ntpd:

# service ntpd restart

3. Počkejte několik minut a poté spusťte „ntpq -p“ a zkontrolujte, zda to funguje.


Cent OS
  1. Změňte výchozí úroveň běhu v CentOS 7 / RHEL 7

  2. příkaz ifconfig nenalezen – CentOS/RHEL 7

  3. Jak provést příkaz Pstack na CentOS/RHEL

  1. Příkaz semanage nebyl nalezen v CentOS 8 / RHEL 8

  2. Jak změnit výchozí port Apache na RHEL/CentOS 7

  3. „-bash:route:command not found“ na CentOS/RHEL 7

  1. Jak vypsat nainstalované balíčky na RHEL 8 / CentOS 8 Linux

  2. Nainstalujte nmap na RHEL 8 / CentOS 8

  3. Jak nainstalovat dig na RHEL 8 / CentOS 8