Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells

NTP Client Configuration on CentOS

Submitted by on May 15, 2014 – 8:31 pm

Just some quick note on configuring NTP client on CentOS/RHEL/Fedora and forcing time update. Just got tired of having to remember these steps every time I run into NTP.

#!/bin/bash
date
yum -y install ntp
cat << EOF > /etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
EOF
chkconfig ntpd on
service ntpd stop
ntpdate 0.pool.ntp.org
service ntpd restart
date

Print Friendly, PDF & Email

Leave a Reply