Das Network Time Protocol (NTP) wird verwendet, um die Uhrzeit eines Computerclients oder -servers mit einem anderen Server zu synchronisieren. So installieren Sie ntp unter Ubuntu 19.04 mit den folgenden Befehlen:
root@thehackertips:~# apt -y install ntp
Um den NTP-Server zu konfigurieren, müssen Sie die Konfigurationsdatei /etc/ntp.conf öffnen. Stellen Sie sicher, dass Sie die Standard-NTP-Server auskommentieren.
# 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
Wenn Sie eine Firewall aktiviert haben, können Sie ntp zur Firewall-Zulassungsliste hinzufügen und den Firewall-Dienst neu starten.
root@thehackertips:~# firewall-cmd --add-service=ntp --permanent
root@thehackertips:~# firewall-cmd --reload
Sie können den NTP-Dienst ntpq -p testen Befehle.
Zum Starten, Stoppen, Neustarten und Anzeigen des NTP-Dienststatus Sie können die folgenden Befehle ausführen:
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
SSH-Server konfigurieren
SSH ist standardmäßig auf Ubuntu 19.04 installiert, muss jedoch aus Sicherheitsgründen konfiguriert werden. WENN es aus irgendeinem Grund nicht installiert ist, können Sie es mit diesen Befehlen installieren:
root@thehackertips:~# apt -y install openssh-server
root@thehackertips:~# systemctl start ssh
Um eine Konfiguration auf SSH vorzunehmen, müssen Sie die Konfigurationsdatei bearbeiten:/etc/ssh/sshd_config .
Es gibt einige Hauptkonfigurationen für SSH, die Sie befolgen müssen:Deaktivieren Sie den SSH-Zugriff für den Root-Benutzer, ändern Sie den SSH-Standardport und erlauben Sie den SSH-Zugriff nur für erforderliche Benutzer. Dazu müssen Sie die Konfigurationsdatei öffnen und diese Zeilen wie folgt hinzufügen:
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
Um sich mit einem anderen SSH-Server zu verbinden, müssen Sie ssh und die IP-Adresse des Remote-Hosts eingeben:
root@thehackertips:~# ssh 172.16.171.226
Auf dem Windows-Client können Sie Putty verwenden, um sich mit SSH mit dem Ubuntu-Server zu verbinden: