GNU/Linux >> Belajar Linux >  >> Linux

Centos 7:Konfigurasi Server NTP

Network Time Protocol (NTP) digunakan untuk menyinkronkan waktu komputer klien atau server ke server lain. Untuk menginstal ntp di centos 7 menggunakan perintah di bawah ini:

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

Untuk mengkonfigurasi server ntp Anda perlu membuka file konfigurasi /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

Jika Anda mengaktifkan firewall, Anda dapat menambahkan ntp ke daftar izin firewall dan memulai ulang layanan firewall.

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

Anda dapat menguji layanan ntp ntpq -p perintah.

Untuk memulai, menghentikan, memulai kembali dan melihat status layanan ntp Anda dapat menjalankan perintah sebagai berikut:

[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

Konfigurasi Server SSH

SSH diinstal pada Centos 7 secara default, namun perlu dikonfigurasi untuk alasan keamanan. JIKA tidak diinstal dengan alasan apa pun Anda dapat menginstalnya dengan perintah ini:

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

Untuk membuat beberapa konfigurasi pada SSH Anda perlu mengedit file konfigurasi:/etc/ssh/sshd_config .

Ada beberapa konfigurasi utama pada SSH yang perlu Anda ikuti:nonaktifkan akses SSH untuk pengguna root, ubah port default ssh dan izinkan akses ssh hanya untuk pengguna yang diperlukan. Untuk melakukan itu Anda perlu membuka file konfigurasi dan menambahkan baris-baris seperti di bawah ini:

[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

Untuk terhubung ke server SSH lain, Anda perlu mengetikkan ssh dan alamat IP dari host jarak jauh:

[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:

Pada klien windows Anda dapat menggunakan Putty untuk terhubung ke Centos 7 dengan SSH:


Linux
  1. Cara Menginstal Server Chrony NTP di CentOS 8

  2. Bagaimana Cara Menginstal dan Mengkonfigurasi NTP untuk Sinkronisasi Waktu di CentOS?

  3. Bagaimana cara Setup Server NTP di CentOS?

  1. Konfigurasikan server MariaDB di CentOS

  2. Cara mengkonfigurasi server dan klien NTP di CentOS / RHEL 7

  3. CentOS / RHEL :Cara mengkonfigurasi server DHCP

  1. Cara mengkonfigurasi server NTP di RHEL 8 / CentOS 8 Linux

  2. Centos 7:Instal, Konfigurasi, Kelola

  3. Centos 7:Konfigurasi Server DNS