ntpd vs ntpdate - Red Hat (RHEL5)

I was instructed to set up NTP with authentication on our linux machines.  We are using Cisco devices as our time servers on our network.

I tested authentication on one of our RHEL 6 boxes and was able to setup authentication and sync with the server.

As I went to config it on one of our RHEL 5 machines I noticed that there is not ntpdate service, only ntpd.  It was my understanding that ntpd (network time protocol daemon) was the server and ntpdate was the client.  It seems that in RHEL 5 there is no ntpdate, so if I want the machine to ONLY be a client do I use ntpd?

Can someone explain this?  For the RHEL 5 machines am I using ntpd as the client?  Also how can I make it so machines can not look at these clients for time updates?
LVL 23
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ntpdate is a utility that is provided by the rpm called 'ntp'.  It is not the client.  For synchronizing you need ntpd installed and configured.  ntpdate would onlyl synchronize once and that too when ntpd is stopped and not running.

you can see if you have it

rpm -qa | grep ntp

Try doing

May be you have it just that your path is not adjusted.
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
ntpd is a daemon that runs to keep your time up to date/time. For this you must configure ntp.conf so it will know where to get the date/time

ntpdate is a command that will use ntp.conf to do an update now as opposed to waiting for ntpd to do it.

If you want you want ntpd, you need to configure ntp.conf. You CAN use ntpdate to do manual updates.

With ntpdate command, you can provide the name of time server manually too and that would eliminate the need of having /etc/ntp.conf file at all.

service ntpd stop
ntpdate <servername>
service ntpd start

Regardless, you need to provide server parameter in /etc/ntp.conf to keep your time synchronized.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

To see your jitter and time and whether your time server is synchronized or not, you can issue the following command

ntpq -p
You no need to stop and start again the ntpd deamon. You can execute the ntpdate command while ntpd deamon is running but you need to use -d for the same.

# ntpdate -d <Time server name/ip>

If you will not use -d with ntpdate then you would require to stop the ntpd service.
savoneAuthor Commented:
Ok, I understand what everyone is trying to say here and I appreciate it.  BUT, as you can see below ntpdate is clearly set up as a service with its own startup scripts in /etc/init.d/.  This is in RHEL 6

# chkconfig --list | grep ntp
ntpd                 0:off      1:off      2:off      3:off      4:off      5:off      6:off
ntpdate              0:off      1:off      2:on      3:on      4:on      5:on      6:off

# ls -lrt /etc/init.d/ntp*
-rwxr-xr-x. 1 root root 1866 Oct 22  2009 /etc/init.d/ntpdate
-rwxr-xr-x. 1 root root 1923 Oct 22  2009 /etc/init.d/ntpd

Also I can start ntpdate without starting ntpd

# service ntpd status
ntpd is stopped
# service ntpdate start
ntpdate: Synchronizing with time server:                   [  OK  ]

As I said, ntpdate can be done, or could be done till RHEL5 when ntpd was NOT running.  Could you actually run ntpdate when ntpd WAS running?
Regarding your second point of ntpdate as a service, I think this discussion would answer your question.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
And as upanwar mentioned that you CAN run ntpdate with option -d.  Thanks upanwar.
savoneAuthor Commented:

That link to fedoraforum.org is exactly what I needed to explain ntpdate as a service.

Now I have just one more question, how can I make it so ntpd will NOT answer queries for time on machines I want to only be clients?
Use restrict in ntp.conf
restrict default ignore

OR specifically by
restrict mask nomodify notrap noquery

For full details, following this link

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.