How to configure time server on CENTOS?
yum install ntpd
Go to ntp.conf file
Vi /etc/ntp.conf
Define the pool as I live in Pakistan so I have to define the Asia pool in conf file like this
server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
after that Add asia pool in conf file like that
Restrict 0.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap no query
restrict 1.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap no query
restrict 2.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap no query
Restrict 3.asia.pool.ntp.org mask 255.255.255.255 nomodify notrap no query
That’s all
Starting NTP
ntpdate -b pool.ntp.org
chkconfig --level 2345 ntpd on
/etc/init.d/ntpd restart
chkconfig --list ntpd
To see if the service started successfully, you should check the system log file.
grep ntpd /var/log/messages
output
galaxy ntpd[1110]: ntpd 4.2.0a@1.1196-r Thu Feb 23 04:42:00 EST 2006 (1)
Client Configuration
Go on client pc of linux
vi /etc/ntp.conf
server 192.168.1.1 **************** I have ip 203.175.75…….
restrict default ignore
restrict 127.0.0.1
restrict 192.168.1.1 mask 255.255.255.255 nomodify notrap noquery
driftfile /var/lib/ntp/drift
give the server of Your time Server
ntpdate 192.168.1.1 I have 203.175.75….
automatically time is synchronies with the time server
Thanks
Kashif shah
| < Prev | Next > |
|---|



Submit Your Articles and HowTos


