GNU/Linux >> Tutoriales Linux >  >> Linux

Ubuntu 19.04:configurar el servidor NTP

El Network Time Protocol (NTP) se utiliza para sincronizar la hora de un cliente o servidor de computadora con otro servidor. Para instalar ntp en Ubuntu 19.04 usando los siguientes comandos:

root@thehackertips:~# apt -y install ntp

Para configurar el servidor ntp, debe abrir el archivo de configuración /etc/ntp.conf. Asegúrese de comentar los servidores ntp predeterminados.

# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
# pool 0.ubuntu.pool.ntp.org iburst
# pool 1.ubuntu.pool.ntp.org iburst
# pool 2.ubuntu.pool.ntp.org iburst
# pool 3.ubuntu.pool.ntp.org iburst


# Use Ubuntu's ntp server as a fallback.
#pool ntp.ubuntu.com
server 0.az.pool.ntp.org
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
restrict 172.16.171.0 mask 255.255.255.0 nomodify notrap
# Needed for adding pool entries
restrict source notrap nomodify noquery

Si tiene activado el cortafuegos, puede agregar ntp a la lista de permitidos del cortafuegos y reiniciar el servicio del cortafuegos.

root@thehackertips:~# firewall-cmd --add-service=ntp --permanent
root@thehackertips:~# firewall-cmd --reload

Puede probar el servicio ntp ntpq -p comandos

Para iniciar, detener, reiniciar y ver el estado del servicio ntp, puede ejecutar los comandos de la siguiente manera:

root@thehackertips:~# systemctl status ntp
â ntp.service - Network Time Service
Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-11-04 07:55:32 EST; 3min 11s ago
Docs: man:ntpd(8)
Process: 8848 ExecStart=/usr/lib/ntp/ntp-systemd-wrapper (code=exited, status=0/SUCCESS)
Main PID: 8866 (ntpd)
Tasks: 2 (limit: 1096)
Memory: 1.0M
CGroup: /system.slice/ntp.service
ââ8866 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 110:117
----------------------------------------------------------
root@thehackertips:~# systemctl stop ntp
root@thehackertips:~# systemctl start ntp
root@thehackertips:~# systemctl restart ntp

Configurar servidor SSH

SSH está instalado en Ubuntu 19.04 de forma predeterminada; sin embargo, es necesario configurarlo por motivos de seguridad. SI no está instalado por algún motivo, puede instalarlo con estos comandos:

root@thehackertips:~# apt -y install openssh-server
root@thehackertips:~# systemctl start ssh

Para realizar alguna configuración en SSH, debe editar el archivo de configuración:/etc/ssh/sshd_config.

Hay algunas configuraciones principales en SSH que debe seguir:deshabilite el acceso SSH para el usuario raíz, cambie el puerto predeterminado de ssh y permita el acceso ssh solo para los usuarios requeridos. Para hacerlo, debe abrir el archivo de configuración y agregar esas líneas como se muestra a continuación:

root@thehackertips:~# vi /etc/ssh/sshd_config
# Add or configure these lines
Port 1234 # for example 1234
PermitRootLogin no # change Yes to No
AllowUsers user1, user2 # user1 and user2 are the ssh allowed users

Para conectarse a otro servidor SSH, debe escribir ssh y la dirección IP del host remoto:

root@thehackertips:~# ssh 172.16.171.226

En el cliente de Windows, puede usar Putty para conectarse al servidor de ubuntu con SSH:


Linux
  1. Servidor Ubuntu 20.04 NTP

  2. Cómo configurar el servidor NTP en Ubuntu y LinuxMint

  3. ¿Cómo sincronizar el tiempo usando NTP en el servidor Ubuntu?

  4. Cómo configurar un servidor Counter Strike en Ubuntu 18.04

  5. Ubuntu 19.04:Configurar vim

Cómo configurar un servidor y cliente NTP en Ubuntu 20.04 LTS

Cómo instalar y configurar Parse Server en Ubuntu 20.04

Cómo instalar y configurar un servidor TeamSpeak en Ubuntu 18.04

Cómo instalar y configurar un servidor de Minecraft en Ubuntu 18.04

Configurar enlaces de red en Ubuntu Server

Centos 7:configurar el servidor NTP