Si se trata de un entorno laboral/empresarial esta actividad pasa a ser una norma, pues de esta forma estaremos seguros de los registros generados en los sitemas y de esta forma realizaremos seguimiento de forma acertada utilizando los registros del sistema.

Puede hallar una definición formal del protocolo NTP en: wikipedia

Instalamos y configuramos la parte cliente de NTP

Para cambiar la zona horaria en sistemas operativos basados en CentOS 5.4 es necesario validar que se encuentra instalado el paquete que nos permitirá establecer la zona horaria en la que nos encontramos, con el comando:

1 # yum list tzadata.noarch

Y la salida debería ser:

1 Loaded plugins: fastestmirror
2 Loading mirror speeds from cached hostfile
3 * addons: mirrors.tummy.com
4 * base: mirrors.igsobe.com
5 * extras: centos.corenetworks.net
6 * updates: mirror.raystedman.net
7 Installed Packages
8 tzdata.noarch        2009k-1.el5           installed
9 tzdata.noarch        2009u-1.el5           installed

En caso que no esté instalado, proceda a instalarlo con el comando:

1 # yum install tzdata.noarch

Y luego proceda a configurar la zona horaria con el comando:

1 tzselect

Responde al asistente escogiendo tu zona horaria por ejemplo: América y luego Caracas.

Ahora bien, para crear un servidor NTP como un cliente de otro servidor NTP para que la hora se actualice automáticamente de forma periódica el procedimiento es el siguiente:

* Instalar el programa ntpdate

1 # yum install ntp.i386

* Agregas una tarea programada para que actualice la hora cada 4 horas:

1 # crontab -e

* Dentro de la edición del crontab agregas la siguiente línea:

1 0 */4 * * * /usr/sbin/ntpdate -u 2.pool.ntp.org

Instalamos y configuramos la parte servidor de NTP

* Se debe instalar el paquete ntpdate como fue indicado anteriormente

* Modificar archivo de configuración /etc/ntp.conf con los siguientes valores:

01 # Permit time synchronization with our time source, but do not
02 # permit the source to query or modify the service on this system.
03 restrict default kod nomodify notrap nopeer noquery
04 #restrict -6 default kod nomodify notrap nopeer noquery
05
06 # Permit all access over the loopback interface.  This could
07 # be tightened as well, but to do so would effect some of
08 # the administrative functions.
09 restrict 127.0.0.1
10 #restrict -6 ::1
11
12 # Hosts on local network are less restricted.
13 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
14
15 # Use public servers from the pool.ntp.org project.
16 # Please consider joining the pool (http://www.pool.ntp.org/join.html).
17 server 0.centos.pool.ntp.org
18 server 1.centos.pool.ntp.org
19 server 2.centos.pool.ntp.org
20
21 #broadcast 192.168.1.255 key 42         # broadcast server
22 #broadcastclient                        # broadcast client
23 #broadcast 224.0.1.1 key 42             # multicast server
24 #multicastclient 224.0.1.1              # multicast client
25 #manycastserver 239.255.254.254         # manycast server
26 #manycastclient 239.255.254.254 key 42  # manycast client
27
28 # Undisciplined Local Clock. This is a fake driver intended for backup
29 # and when no outside source of synchronized time is available.
30 server  127.127.1.0     # local clock
31 fudge   127.127.1.0 stratum 10
32
33 # Drift file.  Put this in a directory which the daemon can write to.
34 # No symbolic links allowed, either, since the daemon updates the file
35 # by creating a temporary in the same directory and then rename()'ing
36 # it to the file.
37 driftfile /var/lib/ntp/drift
38
39 # Key file containing the keys and key identifiers used when operating
40 # with symmetric key cryptography.
41 keys /etc/ntp/keys
42
43 # Specify the key identifiers which are trusted.
44 #trustedkey 4 8 42
45
46 # Specify the key identifier to use with the ntpdc utility.
47 #requestkey 8
48
49 # Specify the key identifier to use with the ntpq utility.
50 #controlkey 8
51
52 # Permisos que se asignara para cada servidor de tiempo.
53 # En los ejemplos, no se permite a las fuente consultar, ni
54 # modificar el servicio en el sistema ni enviar mensaje de
55 # registro.
56 restrict 0.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
57 restrict 1.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
58 restrict 2.centos.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
59
60 # Se Activa la difusion hacia los clientes
61 broadcastclient

* Iniciar el servicio con:

1 # service ntpd start

* Agregar el servicio para que se inicie de forma automática con el sistema:

1 # chkconfig ntpd on

* Finalmente permitir al firewall recibir solicitudes de ntp de nuestros clientes agregando al archivo: /etc/sysconfig/iptables la siguiente línea:

1 -A RH-Firewall-1-INPUT -s 192.168.1.0/24 -m state --state NEW -p udp --dport 123 -j ACCEPT

Antes de la línea:

1 -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

* Reiniciamos el firewall:

1

# service iptables restart

Via: blogofsysadmins.com

Por admin

Deja una respuesta

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock