Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a machine acting as a tftp and telnet server. I'd like a way to monitor (in real time if possible) connections made to the two services. For example, when a tftp transfer is occurring, I'd like some visual indication that the transfer is taking place (showing the bytes transmitted would be great). As for telnet, seeing when a connection is made and terminated would be fine. Any ideas?
Please, no lectures on the insecurity of these two services. The box is behind a firewall and even if some internal malicious mad hacker decided to go postal on my server, I don't care. I'll make more!
Not exactly what you want, but if you have nothing else, you can try this :
create a script, called :listen.bin
%cat listen.bin
netstat -an | grep ESTABLISHED | grep :23
netstat -an | grep ESTABLISHED | grep :69
%
This script will tell you whether or not a telnet or tftp session is CURRENTLY present.
now, in crontab create an entry that calls this script every minute (or 10 secs, ...), If this script generates output, then write a time stamp to a logfile.
I agree that this method will not give you the number of transferred bytes. you will only have the timestamps when a telnet / tftp session was active.
for the number of transfered bytes i indeed think you need to play with the ouput of tcpdump.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.