Diferencias
Muestra las diferencias entre dos versiones de la página.
| Próxima revisión | Revisión previa | ||
| doc:tec:sis:gnu:hora:inicio [2026/01/16 12:31] – creado fepg | doc:tec:sis:gnu:hora:inicio [2026/02/02 14:25] (actual) – fepg | ||
|---|---|---|---|
| Línea 1: | Línea 1: | ||
| + | ====== [Linux] Configurar la hora ====== | ||
| + | ===== Sincronizar hora con NTP o systemd‑timesyncd en Debian 13 ===== | ||
| + | |||
| + | <WRAP center round todo 60%> | ||
| + | |||
| + | Para sincronizar la hora con NTP en Debian 13 lo habitual es usar **systemd‑timesyncd** a través de `timedatectl`, | ||
| + | |||
| + | **Comprobar estado actual** | ||
| + | |||
| + | * Ver estado de hora, NTP y zona horaria: < | ||
| + | |||
| + | timedatectl status | ||
| + | |||
| + | </ | ||
| + | - System clock synchronized: | ||
| + | - NTP service: debería decir '' | ||
| + | |||
| + | **Usar systemd‑timesyncd** | ||
| + | |||
| + | Debian moderno suele integrar `systemd‑timesyncd` como cliente SNTP ligero, pero puede no venir instalado o habilitado por defecto. | ||
| + | |||
| + | - Instalar (si no existe): < | ||
| + | |||
| + | # apt update | ||
| + | # apt install systemd-timesyncd | ||
| + | |||
| + | </ | ||
| + | - Habilitar y arrancar: < | ||
| + | |||
| + | # systemctl enable --now systemd-timesyncd.service | ||
| + | |||
| + | </ | ||
| + | - Activar la sincronización NTP en systemd: < | ||
| + | |||
| + | # timedatectl set-ntp true | ||
| + | |||
| + | </ | ||
| + | - Verificar: < | ||
| + | |||
| + | # timedatectl status | ||
| + | # systemctl status systemd-timesyncd.service | ||
| + | |||
| + | </ | ||
| + | |||
| + | **Configurar servidores NTP en systemd‑timesyncd** | ||
| + | |||
| + | - Editar el archivo de configuración: | ||
| + | |||
| + | # nano / | ||
| + | |||
| + | </ | ||
| + | - En la sección '' | ||
| + | ini | ||
| + | [Time] | ||
| + | NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org | ||
| + | FallbackNTP=2.debian.pool.ntp.org 3.debian.pool.ntp.org | ||
| + | |||
| + | </ | ||
| + | - Aplicar cambios: < | ||
| + | |||
| + | # systemctl restart systemd-timesyncd.service | ||
| + | # timedatectl status | ||
| + | |||
| + | </ | ||
| + | |||
| + | **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/ | ||
| + | |||
| + | - Instalar `ntp` (ejemplo): < | ||
| + | |||
| + | # apt update | ||
| + | # apt install ntp | ||
| + | |||
| + | </ | ||
| + | |||
| + | # apt install chrony | ||
| + | |||
| + | </ | ||
| + | - Desactivar la sincronización de systemd‑timesyncd para evitar conflictos: < | ||
| + | |||
| + | # timedatectl set-ntp false | ||
| + | # systemctl disable --now systemd-timesyncd.service | ||
| + | |||
| + | </ | ||
| + | - Configurar servidores en: | ||
| + | - ''/ | ||
| + | - ''/ | ||
| + | - Después reinicia el servicio correspondiente: | ||
| + | |||
| + | # systemctl restart ntp | ||
| + | |||
| + | </ | ||
| + | |||
| + | # systemctl restart chrony | ||
| + | |||
| + | </ | ||
| + | |||
| + | **Forzar y verificar sincronización** | ||
| + | |||
| + | - Forzar actualización rápida (útil después de cambiar servidores): | ||
| + | - Con systemd‑timesyncd, | ||
| + | |||
| + | # timedatectl set-time " | ||
| + | |||
| + | </ | ||
| + | - Comprobar otra vez: < | ||
| + | |||
| + | timedatectl status | ||
| + | |||
| + | </ | ||
| + | |||
| + | **Enlaces** | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | **Vídeos** | ||
| + | - [[https:// | ||
| + | \\ | ||