¡Esta es una revisión vieja del documento!


[Linux] Configurar la hora

Falta verificar esta página

Para sincronizar la hora con NTP en Debian 13 lo habitual es usar systemd‑timesyncd a través de `timedatectl`, o bien instalar un demonio NTP completo como `ntp`/`chrony` si necesitas más opciones.

Comprobar estado actual

  • Ver estado de hora, NTP y zona horaria:
    timedatectl status
    

    En la salida revisa:

    1. System clock synchronized: debería ser yes.
    2. NTP service: debería decir active si se usa systemd‑timesyncd u otro cliente NTP integrado.

Usar systemd‑timesyncd

Debian moderno suele integrar `systemd‑timesyncd` como cliente SNTP ligero, pero puede no venir instalado o habilitado por defecto.

  1. Instalar (si no existe):
    # apt update
    # apt install systemd-timesyncd
    
  2. Habilitar y arrancar:
    # systemctl enable --now systemd-timesyncd.service
    
  3. Activar la sincronización NTP en systemd:
    # timedatectl set-ntp true
    
  4. Verificar:
    # timedatectl status
    # systemctl status systemd-timesyncd.service
    

    Si el servicio aparece como active (running) y NTP service: active, el reloj se sincroniza con servidores NTP configurados en systemd‑timesyncd.

Configurar servidores NTP en systemd‑timesyncd

  1. Editar el archivo de configuración:
    # nano /etc/systemd/timesyncd.conf
    
  2. En la sección [Time], define tus servidores:
    ini
    [Time]
    NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org
    FallbackNTP=2.debian.pool.ntp.org 3.debian.pool.ntp.org
    
  3. Aplicar cambios:
    # systemctl restart systemd-timesyncd.service
    # timedatectl status
    

    En entornos con servidor NTP interno pon la IP o nombre de ese servidor en `NTP=` y deja `FallbackNTP` con servidores públicos.

Usar un demonio NTP completo (ntp o chrony)

  • Si necesitas más precisión, estadísticas o servir tiempo a otros equipos, conviene instalar un cliente/servidor NTP completo.
  1. Instalar `ntp` (ejemplo):
    # apt update
    # apt install ntp
    

    O bien chrony:

    # apt install chrony
    
  2. Desactivar la sincronización de systemd‑timesyncd para evitar conflictos:
    # timedatectl set-ntp false
    # systemctl disable --now systemd-timesyncd.service
    
  3. Configurar servidores en:
    1. /etc/ntp.conf para ntp.
    2. /etc/chrony/chrony.conf para chrony.
  4. Después reinicia el servicio correspondiente:
    # systemctl restart ntp
    

    o

    # systemctl restart chrony
    

    ntp y chrony proporcionan más opciones de ajuste fino, pero para la mayoría de escritorios y servidores simples basta con systemd‑timesyncd.

Forzar y verificar sincronización

  1. Forzar actualización rápida (útil después de cambiar servidores):
    1. Con systemd‑timesyncd, lo normal es esperar unos minutos; si la hora está muy desfasada, puedes ajustarla una vez:
      # timedatectl set-time "2025-12-19 10:44:00"
      

      y dejar que NTP haga los ajustes finos posteriores.

  2. Comprobar otra vez:
    timedatectl status
    

    Cuando el campo `System clock synchronized` pase a `yes` y el desajuste sea mínimo, la sincronización está funcionando correctamente.


  • doc/tec/sis/gnu/hora/inicio.1770038457.txt.gz
  • Última modificación: 2026/02/02 14:20
  • por fepg