Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

to retrive list of ntp clients accesing NTP servers

Posted on 2014-01-28
2
463 Views
Last Modified: 2014-01-30
Hi All,

I want to retrieve list of all clients accessing my ntp servers like there IP and hostname for inventory - please help me with that.
0
Comment
Question by:apunkabollywood
2 Comments
 
LVL 13

Accepted Solution

by:
Daniel Helgenberger earned 500 total points
ID: 39815209
Hello apunkabollywood,

I do not know if it is possible to log ntpd access, but of course iptables can do so; I think this is one of the easiest ways:
Create a rule for 123/udp on your NTP server, like this:
iptables -A INPUT -p udp -s 0.0.0.0/0 --dport 123 -j LOG --log-level 6 --log-prefix='ntpaccess'

Open in new window


Note, these might be logged to your kernel.log depenting on your distro. You might want to change the location to your liking with rsyslog like this:
$ cat /etc/rsyslog.d/ntpdaccess
:msg,contains,"ntpaccess" /var/log/ntpdaccess.log

Open in new window

Restart rsyslog after changing configs.

Note: this should work on any normal commonly modern linux (Debian Lenny+, Ubuntu 12+, RHEL/CentOS 6, Fedora 14+, ect.)
0
 
LVL 29

Expert Comment

by:serialband
ID: 39815967
It might be in your /var/log/syslog, but it depends on your configuration.

http://serverfault.com/questions/359835/where-are-the-ntpd-log-file-located-and-how-can-we-configure-the-ntpd-log-file

You can read up on how to configure NTP here:  http://support.ntp.org/bin/view/Support/ConfiguringNTP

You can even set up access restrictions.
http://support.ntp.org/bin/view/Support/AccessRestrictions
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question