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
Replies
Jeff Jacobs May 1st 2006

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 June 18th 2006

Thank you for this valueable tip!

Piotr

Pimi March 16th 2009

Really helpful! Thanks a lot.

nono November 18th 2009

Cheers, that was what I am looking for.

Kojta December 9th 2010

Thanks, very helpful! :)

iCEMAN May 28th 2011

Thank you :P

yassine August 10th 2012

Thank you so much ^_^

All content licensed under the Creative Commons License