CAN WE RECREATE A USER SESSION ON AIX 3.2.4?

ITEM: RTA000036387



QUESTION:                                                                       
Two questions:                                                                  
                                                                                
1.  Is there a way to recreate a user session on AIX 3.2.4?  Other              
    than looking at their .history file?  Or is there a way to capture          
    what they key in and later recreate that?                                   
2.  Is there a way to view a user screen from another terminal?                 
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A: There are several ways to recreate a user session in AIX.  I will            
   list these possibilities below.                                              
                                                                                
   1)  Issue the 'script ' command before you start your              
       session.  This will create a file with the given filename that           
       contains all user input and the resulting system output and             
       errors.                                                                  
                                                                                
       To end your script session, you can use the 'd' keystroke.         
       At this point you could issue either of the following commands to        
       view this script file:                                                   
                                                                                
          vi                                                          
          pg                                                          
                                                                                
   You may wish to create a small script which will clean up this file          
   before viewing it.  'UNIX Power Tools' by Jerry Peek and Assoc.              
   documents the following script called 'script.tidy':                         
                                                                                
   ----------                                                                   
   #¢/bin/sh                                                                   
   eval echo m=M b=H  tr 'MH' '015010'                    
   exec sed "s/$m$//                                                        
   x                                                                     
   s/$b$b//                                                    
   t x" $                                                                
   ----------                                                                   
   Key:   backtic    pipe symbol    backslash                     
          left square bracket    right square bracket                 
          carot symbol  asterisk                                  
                                                                                
      After creating this file and issuing the command                          
      'chmod +x script.tidy', you can view your script file with the            
      command 'script.tidy   pg                                 
                                                                                
   2)  You can use the 'capture ' command.  This command will        
       dump the contents of the screen to ' each time the user        
       issues the 'p' keystroke.  If you are ROOT, you can also           
       send a screen dump directly to another 'aixterm' as will be              
       described below.                                                         
                                                                                
   Both 'capture' and 'script' are documented in InfoExplorer.                  
                                                                                
   3)  You can start a session with the following command:                      
                                                                                
          ksh -iv 2>&1  tee /tmp/logfile                                  
                                                                                
       This will create a file named '/tmp/logfile'.  Any user that             
       wishes to monitor your keystrokes and corresponding system output        
       can then open an aixterm on their display and issue the                  
       following command:                                                      
                                                                                
          tail -f /tmp/logfile                                                  
                                                                                
       Multiple users can watch this file simultaneously.  As you enter         
       commands on the screen, these user's will see output in a                
       somewhat 'choppy' but readable manner appear on their screen.            
                                                                                
   4)  You can issue the 'w' command.  Note what aixterms are currently         
       open (pts value).  You can then issue the following command:             
                                                                                
          aixterm -d  =81x25 &                                 
                                                                                
       You can issue this command multiple times to place an aixterm            
       on the screen of each user that wishes to monitor your commands.         
                                                                               
       You can now issue the 'w' command again to determine the 'pts'           
       value of each aixterm that has been added.  With these values you        
       can issue the following command:                                         
                                                                                
       ksh -iv  tee /dev/pts/X  /dev/pts/Y 
WWQA: ITEM: RTA000036387 ITEM: RTA000036387
Dated: 03/1996 Category: RISCMGMT
This HTML file was generated 99/06/24~12:43:13
Comments or suggestions? Contact us