You are on page 1of 9

Configure Network Time Protocol (NTP) Server

NTP is a protocol to keep server time synchronized with one or more time sources. The NTP daemon (ntpd) should be
considered for systems which are normally kept permanently on. Systems which are required to use broadcast or
multicast IP, or to perform authentication of packets with the Autokey protocol, should consider using ntpd.

ntpd
chronyd

Choosing Between Chrony and NTP

In RHEL 7 ntpd is replaced by chronyd as the default network time protocol daemon.
Basic configuration for synchronize time and date is stored in the file /etc/chrony.conf.
ntpd is still included in yum repository for customers who need to run an NTP service.
Chrony is a different implementation of the network time protocol (NTP) than the network time protocol daemon
(ntpd) that is able to synchronize the system clock faster and with better accuracy than ntpd.

[1] NTPd Configuration

# Install NTPd
$ sudo yum -y install ntp

#Configuration file
$ vi /etc/ntp.conf

List of NTP server

/
Start NTP server

$ systemctl start ntpd


# autostart
$ systemctl enable ntpd

If Firewalld is running,allow NTP service. NTP uses 123/UDP

$ sudo firewall-cmd --add-service=ntp --permanent


$ sudo firewall-cmd --reload

Verify NTP is running

$ ntpq -p /
[2] Chronyd Configuration

# Install Chrony
$ sudo yum -y install chrony

#Configuration file
$ vi /etc/chrony.conf

# start chronyd
$ sudo systemctl start chronyd

# add to strtup
/
$ suudo systemctl enable chronyd

Allow NTP Service in Firewall.

$ firewall-cmd --add-service=ntp --permanent

$ firewall-cmd --reload

Verify it works normally.

$ sudo chronyc sources

SSH Key-Pair Authentication.

$ ssh-keygen -t rsa

$ mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

Transfer the secret key created on the server to a client.

Client Machine

$ scp minju@192.168.0.120:/home/minju/.ssh/id_rsa ~/.ssh/


$ chmod 700 ~/.ssh
$ ssh -i .ssh/id_rsa user@192.168.0.120

/
DNS & DHCP Server Configuration.
Dnsmasq is the lightweight DNS forwarder and DHCP server software

$ sudo yum install dnsmasq

# Configure Dnsmasq.
$ sudo vim /etc/dnsmasq.conf

/
/
/
$ systemctl start dnsmasq
$ systemctl enable dnsmasq

For DNS records, add them in /etc/hosts.

$ sudo vim /etc/hosts

/
Allow DNS to firewall services.

$ sudo firewall-cmd --add-service=dns --permanent


$ sudo firewall-cmd --reload

You might also like