GNU/Linux >> Linux Esercitazione >  >> Linux

Ubuntu 19.04:Configura il server NTP

Il Network Time Protocol (NTP) viene utilizzato per sincronizzare l'ora di un computer client o server con un altro server. Per installare ntp su Ubuntu 19.04 usando i comandi seguenti:

root@thehackertips:~# apt -y install ntp

Per configurare il server ntp è necessario aprire il file di configurazione /etc/ntp.conf. Assicurati di commentare i server ntp predefiniti.

# 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

Se hai il firewall abilitato, puoi aggiungere ntp all'elenco dei firewall consentiti e riavviare il servizio firewall.

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

Puoi testare il servizio ntp ntpq -p comandi.

Per avviare, arrestare, riavviare e controllare lo stato del servizio ntp È possibile eseguire i comandi come segue:

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

Configura server SSH

SSH è installato su Ubuntu 19.04 per impostazione predefinita, tuttavia è necessario configurarlo per motivi di sicurezza. SE non è installato per nessun motivo Puoi installarlo con questi comandi:

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

Per effettuare alcune configurazioni su SSH è necessario modificare il file di configurazione:/etc/ssh/sshd_config .

Ci sono alcune configurazioni principali su SSH che devi seguire:disabilitare l'accesso SSH per l'utente root, cambiare la porta predefinita ssh e consentire l'accesso ssh solo agli utenti richiesti. Per farlo è necessario aprire il file di configurazione e aggiungere quelle righe come di seguito:

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

Per connetterti a un altro server SSH devi digitare ssh e l'indirizzo IP dell'host remoto:

root@thehackertips:~# ssh 172.16.171.226

Sul client Windows puoi usare Putty per connetterti al server Ubuntu con SSH:


Linux
  1. Server NTP Ubuntu 20.04

  2. Come configurare il server NTP su Ubuntu e LinuxMint

  3. Come sincronizzare l'ora usando NTP nel server Ubuntu?

  4. Come configurare un server Counter Strike su Ubuntu 18.04

  5. Ubuntu 19.04:Configura vim

Come configurare un server e un client NTP su Ubuntu 20.04 LTS

Come installare e configurare Parse Server su Ubuntu 20.04

Come installare e configurare un TeamSpeak Server su Ubuntu 18.04

Come installare e configurare un server Minecraft su Ubuntu 18.04

Configura il legame di rete nel server Ubuntu

Centos 7 :Configura il server NTP