cancel
Showing results for 
Search instead for 
Did you mean: 

NTP setup?

SOLVED
Go to solution
Sachin Patel
Honored Contributor

NTP setup?

How do I setup NTP on linux?
Is is only /etc/ntp.conf file needs to be changed? I have NTP server running on HP-UX.

Sachin
Is photography a hobby or another way to spend $
4 REPLIES
Albert E. Whale, CISSP
Honored Contributor

Re: NTP setup?

Yes, only the /etc/ntp.conf file needs to be updated. You can use the same information you are using on HP-UX and then start the xntpd demon on Linux by using the following command:

/etc/rc.d/init.d/xntpd start

Let me know if you need assistance getting it into your startup regime as well.

Hope that helps!
Sr. Systems Consultant @ ABS Computer Technology, Inc. http://www.abs-comptech.com/aewhale.html & http://www.ancegroup.com
Mark Fenton
Esteemed Contributor
Solution

Re: NTP setup?

Sachin,

The first question is whether you have ntp installed on the linux machine. If you do, the executable should be located somewhere like /sbin/ntpd or /usr/sbin/ntpd, with a configuration file /etc/ntp.conf.

It sounds like you want to use your HPUX box for the time server. This is easy to configure in the ntp.conf using the "server" directive:

server hpux.ip.addr prefer

For security, you should probably disable broadcast and select an authentication method (or lack thereof).

If the service is running on the linux box already, stop it and restart.

# ps aux |grep ntp
# kill pid_number
# /usr/sbin/ntpd

Assuming you are using a BSD style startup control system, verify that the appropriate symlinks and scripts are installed in the /etc/rc.d subdirectories. the example from my installation:

# ls -l /etc/rc.d/init.d |grep ntp
-rwxr-xr-x 1 root root 1412 Apr 5 11:22 ntpd
# ls -l /etc/rc.d/rc3.d |grep ntp
0 lrwxrwxrwx 1 root root 14 Apr 25 00:53 K74ntpd -> ../init.d/ntpd
0 lrwxrwxrwx 1 root root 14 May 5 19:36 S26ntpd -> ../init.d/ntpd

Similar entries exist in rc5.d also. With all these, your service should start when you enter runlevel 3 or higher and look to your hpux box as its time server.

Best of luck.
Mark
Steven E. Protter
Exalted Contributor

Re: NTP setup?

/etc/init.d/xntpd restart kills and restarts the daemon

If you are running ipchains, you need to open up the proper port on the firewall

-A input -s 66.92.143.194/0 -d 0/0 123 -p tcp -y -j ACCEPT
-A input -s 66.92.143.194/0 -d 0/0 123 -p udp -j ACCEPT

/etc/init.d/ipchains restart

Please don't use my IP address, its not a time server. You probably want to put the IP addresses of your chosen time servers for the highest level of security.


Steve

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com