GNU/Linux >> Linux Esercitazione >  >> Linux

Centos 7 :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 centos 7 usando i comandi seguenti:

[root@thehackertips ~]# yum -y install ntp

Per configurare il server ntp è necessario aprire il file di configurazione /etc/ntp.conf .

# Hosts on local network are less restricted.
restrict 172.16.171.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).

# add your ntp server here
server 0.az.pool.ntp.org

#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client

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 ntpd
ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
Active: active (running) since Mon 2019-10-21 07:01:13 EDT; 1 day 1h ago
Process: 592 ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS (code=exited, status =0/SUCCESS)
Main PID: 603 (ntpd)
CGroup: /system.slice/ntpd.service
ââ603 /usr/sbin/ntpd -u ntp:ntp -g
ââ604 /usr/sbin/ntpd -u ntp:ntp -g

[root@thehackertips ~]# systemctl stop ntpd
[root@thehackertips ~]# systemctl start ntpd
[root@thehackertips ~]# systemctl restart ntpd

Configura server SSH

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

[root@thehackertips ~]# yum -y install openssh-server openssh-clients
[root@thehackertips ~]# service sshd start

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

Esistono alcune configurazioni principali su SSH che è necessario seguire:disabilitare l'accesso SSH per l'utente root, modificare 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.201
The authenticity of host '172.16.171.201 (172.16.171.201)' can't be established.
ECDSA key fingerprint is ee:3e:9b:e2:9f:3c:b9:cb:33:c6:70:6f:95:c5:9d:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.171.201' (ECDSA) to the list of known hosts.
[email protected]'s password:

Sul client Windows puoi usare Putty per connetterti a Centos 7 con SSH:


Linux
  1. Come installare Chrony NTP Server su CentOS 8

  2. Come installare e configurare NTP per la sincronizzazione dell'ora in CentOS?

  3. Come configurare il server NTP in CentOS?

  4. Configura il server MariaDB su CentOS

  5. Come configurare server e client NTP in CentOS / RHEL 7

Come installare e configurare GlusterFS su CentOS 7/CentOS 8

Come configurare NGINX su un server CentOS 7

Come installare e configurare Subversion (SVN) su CentOS 7

Come installare e configurare Sandstorm Server su CentOS 8

Come configurare il server VNC su CentOS/RHEL 6

Ubuntu 19.04:Configura il server NTP