Solved

to retrive list of ntp clients accesing NTP servers

Posted on 2014-01-28
2
447 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 27

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now