Build a Public NTP Server

Install NTPd and Configure NTP server for time adjustment.

[root@dlp ~]# yum -y install ntp
[root@dlp ~]# vi /etc/ntp.conf
# line 18: add the network range you allow to receive requests publicly
restrict 0.0.0.0 mask 128.0.0.0 nomodify notrap

# change servers for synchronization

#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server bsti1.time.gov.bd iburst
server bsti2.time.gov.bd iburst
[root@dlp ~]# systemctl start ntpd
[root@dlp ~]# systemctl enable ntpd

If Firewalld is running, allow NTP service. NTP uses 123/UDP. Continue reading “Build a Public NTP Server” »

Share

Installing NTP Service and change timezone in CentOS 6 / CentOS 7

Let’s install NTP service first:

yum install ntp

Configure NTP services by updating the following section (only if appropriate):

nano /etc/ntp.conf

And by commenting on the sections:

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

In my case I used the following National Time Server of Bangladesh:

server bsti1.time.gov.bd
server bsti2.time.gov.bd

save and restart the ntp service.

Change Timezone on a CentOS 6 and 7

How do I see the current time zone on CentOS Linux?

Type the date command or the ls command:

$ date
$ ls -l /etc/localtime

Another option is to type the following command on systemd based distro such as CentOS 7 to see timezone along with the grep command and timedatectl command: Continue reading “Installing NTP Service and change timezone in CentOS 6 / CentOS 7” »

Share

NTP Adjust date on Linux

If you want to set date/time on linux manually (instead of using synchronization like ntp) you may use the date command to do it.

Login as root and run the following command, it will show you the

current date/time.

[root@servername ~]# date

Output will be like Tue Aug 23 12:32:22 EDT 2011

Now to set the desired date/time use the same date command with an argument of your required date/time as following format; Continue reading “NTP Adjust date on Linux” »

Share