Log linux telnet sessions

So I was doing some research on how to turn on logging for a telnet session on a linux box and I found this article. Basically it suggests that the user look into the script command.

I read the man page and found that script is actually pretty badass. Rather than building logging into your telnet application, why not build a wrapper that you can use with any program? That's what script is. Just run the command tell it where to output the data.

script -c "telnet myhost.domain.com" /tmp/output.log
Leave A Reply - 7 Replies
Jeff Jacobs 2006-05-01 08:43am - jeffjacobsbald@... - Logged IP:

Thanks for posting this info. I knew nothing of script and it is exactly what I needed. I am a software engineer having done mostly embedded software til now. I needed a way to log a telnet session for talking to one of our devices which had a telnet server that reports commands of a proprietary protocol. I tried the -n option of telnet and I still do not know what this option accomplishes. The script commands works perfectly. Thanks again!

PJ 2006-06-18 10:45am - No Email - Logged IP:

Thank you for this valueable tip!


Pimi 2009-03-16 11:40pm - No Email - Logged IP:

Really helpful! Thanks a lot.

nono 2009-11-18 11:30am - No Email - Logged IP:

Cheers, that was what I am looking for.

Kojta 2010-12-09 06:58am - No Email - Logged IP:

Thanks, very helpful! :)

iCEMAN 2011-05-28 04:34pm - No Email - Logged IP:

Thank you :P

yassine 2012-08-10 07:25am - No Email - Logged IP:

Thank you so much ^_^

All content licensed under the Creative Commons License