From Jason Joyce on 07 Oct 1998
How can you log a telnet session using it from an xterm in Linux? I need to create a log of my actions during a telnet session, and I know that you can do it using telnet under Microsoft. And I know that if those guys have it, then they must have copied it from somewhere, and so I believe that it is possible using Linux, but I can't find any way.
Thanks for any help, Jason
You can run the 'script' command (which creates a "transcript" named "typescript" by default.
You can also run the 'screen' utility, which, among many other features, allows you to take open multiple screen sessions through one virtual console, telnet, xterm, or even dial-up VT100 sessions and dumb terminals. Think of having all the power of your virtual consoles from any sort of terminal/shell session. You can do screen snapshots, open and close log files, view a backscroll buffer (with 'vi' like search features), mark and paste text (keyboard driven), do a screen lock, and even detach the whole screen session from your current terminal, xterm or whatever (and re-attach to it from any login, from that or any other terminal, later).
I routinely run 'screen' for all my sessions. When I log into one of my ISP shell accounts I prefer to run 'screen' at the far end because it will auto-detach if my modem disconnects me. So, I can redial, re-attach and resume my work. I can also dial into my home system, do a 'kill -HUP' on my screen process (actually a 'screen -d -R' will auto located, HUP, and re-attach all at once) and continue working on all ten of the interactive programs that I had running at the time.
There are other ways you can do this. There was a sample script in 'expect' that did this in about 10 lines of TCL/expect code.
You can also use Kermit (ckermit, from Columbia University). This is a communications package, file transfer package and network client. I wrote an article for SysAdmin Magazine about a year ago to describe its use as a telent/rlogin client.
In addition to be fully scriptable and supporting the same file transfers over TCP/IP as it does over any serial connection; it's also possible to do logging and exentisive debugging using Kermit.
The next version (currently still in beta?) should support Kerberos authentication and encryption (one of several enhancements that I beat up on Frank de la Cruz --- it's principal author and co-ordinator --- about while researching my article).
So, there's about four options off the top of my head.