Installare ntp server su CentOS 6
NTP (Network Time Protocol) è un protocollo che viene utilizzato per sincronizzare l’orario dei computer all’interno di una rete pubblica o privata, su linux troviamo il server ntpd e il client ntpdate
Su Linux CentOS 6 il demone ntp è installabile tramite yum:
[[email protected] ~]# yum install ntp
...
...
...
Running Transaction
Installing : ntpdate-4.2.6p5-1.el6.centos.i686 1/2
Installing : ntp-4.2.6p5-1.el6.centos.i686 2/2
Verifying : ntp-4.2.6p5-1.el6.centos.i686 1/2
Verifying : ntpdate-4.2.6p5-1.el6.centos.i686 2/2
Installed:
ntp.i686 0:4.2.6p5-1.el6.centos
Dependency Installed:
ntpdate.i686 0:4.2.6p5-1.el6.centos
Complete!
[[email protected] ~]#
Nel caso in cui ci fossero le connessioni bloccate in input dal firewall, aprire la porta udp 123:
[[email protected] ~]# iptables -I INPUT -i eth0 -p udp --dport 123 -j ACCEPT
Aprire il file “/etc/ntp.conf” con l’editor preferito e sostituire le righe:
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
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
con:
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server ntp1.inrim.it
server ntp2.inrim.it
In questo caso la distribuzione CentOS si sincronizzerà con i server ntp I.N.RI.M e ridistribuirà l’orario ai client da cui riceverà le richieste.
Per far partire il servizio digitare:
[[email protected] ~]# /etc/init.d/ntpd start
Avvio di ntpd: [ OK ]
[[email protected] ~]#
Per rendere il servizio eseguibile ad ogni avvio del sistema scrivere:
[[email protected] ~]# chkconfig ntpd on