Operating System - HP-UX
1833474 Members
2872 Online
110052 Solutions
New Discussion

Re: capture terminal session

 
Gary Glick
Frequent Advisor

capture terminal session

All,
I was wondering if it would be possible to capture the output from a telnet session on the server side and save it to a file for later review. I currently log entries typed at the command line by session, but for trouble shooting purposes it might be useful to see everything that would have been sent to the user. Keep in mind that the user on the other end still needs to see the output. I want to send a copy of it to a file, if possible.
I'm running running HP-UX 11.0 on the server in question.

Thank you

Gary
8 REPLIES 8
Raj D.
Honored Contributor

Re: capture terminal session



Gary,

"if it would be possible to capture the output from a telnet session " :

Yes, you can do it by runnning the session with log enabled mode,

If you are using telnet client like putty , just do the following :

Putty session--> right click on the top --> change settings--> Logging --> Log All session output and provide a file name (ex: server1.txt ) , and till the end of the session everything will be logged in that file.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Mustafa Gulercan
Respected Contributor

Re: capture terminal session

hi Gary;
if the output of session is the aim,i think it is not necessary captured on the server side.You can capture session from your PC by using SecureCRT or like other programs.

regards;
mustafa
Patrick Wallek
Honored Contributor

Re: capture terminal session

Have a look at the 'script' command.

If you were to insert this into a users ~/.profile, then everything they do would be recorded in the file specified.

Be aware that this is fine for command line stuff, but it really doesn't work well if the user is using menus and things like SAM.

Raj D.
Honored Contributor

Re: capture terminal session

Gary,

Also you can put a line on the .profile of the user , and it makes a typescript of everything printed on your terminal.
All will be logged in to the file,


cd ~username
edit the .profile


# enter the line in .profile,
script logfilename.txt

#####

And all output of the session will be logged in this file.

Check your space on that filesystem as the script file grows significantly, and logs everything including menu based programs.

For further details you can check :
http://docs.hp.com/en/B2355-90680/script.1.html

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Gary Glick
Frequent Advisor

Re: capture terminal session

Hi everyone,
Thanks for your idea.
I know you can log from putty or reflections but that wasn't what I wanted to do.

I'd forgotten about the script command and I'll give it a whirl and see if that works for me. The account users do not do anything fancy just some command line stuff and the sessions tend to be pretty short. I'll tinker with it.

thanks

Gary
Gary Glick
Frequent Advisor

Re: capture terminal session

One more question on this is there a way to suppress the "Script started" message that is displayed and the need to type exit twice to terminate a session.

Most of the work done on these logins are done automatically via remote script execution and I would want to avoid the need changes on the other end.

thanks again

Gary
Volker Borowski
Honored Contributor

Re: capture terminal session

Hi,
Keep in mind, that activating such logging tools could lead to unencrypted passwords stored in plain text files at non-secure places !
Volker
Gary Glick
Frequent Advisor

Re: capture terminal session

Yes, Thank you for bringing that up,it might be possible to capture that inadvertently.

This is a fairly limited circumstance we're interested in monitoring. Very few people have access to the machine to begin with and I can place the logs in a place in which even fewer do or lock read access down to root only. If we feel that it's a security risk I can encrypt the files too.

Also the script command doesn't capture typed characters only echoed characters so normal password entry should be protected.