Operating System - HP-UX
1753797 Members
7522 Online
108799 Solutions
New Discussion юеВ

monitor user activity in real time

 
SOLVED
Go to solution
Brian Bartley
Frequent Advisor

monitor user activity in real time

All,
Is there a way to monitor someone's shell to see what they are doing? We need to have a non-HP vendor do some work on our system to upgrade their software.

Is it possible to somehow set up a display that will show me what commands they enter, basically exporting their display to another monitor so I can see what they're typing in real time? They ssh in with a terminal emulator, probably Putty or something similar.
Thanks,

Brian
Brian Bartley
Campus Card Services
Indiana University
6 REPLIES 6
Brian Bartley
Frequent Advisor

Re: monitor user activity in real time

I didn't give any system info. A-500 running 11.11. No graphics card, we have a console monitor and a second monitor connected via serial.
Brian Bartley
Campus Card Services
Indiana University
Patrick Wallek
Honored Contributor

Re: monitor user activity in real time

You could possibly use the script command for this.

Add the command 'script somefile' to the .profile of this user. The you can do a 'tail -f somefile' to monitor what they are doing. You can, of course, replace 'somefile' with any file name in any directory, that the user has write access to, that you wish.
Brian Bartley
Frequent Advisor

Re: monitor user activity in real time

Patrick, Thanks for that suggestion, I was not aware of the script command, I'll do some testing with it.

I'll leave the thread open for a day in case anyone has other ideas. Thanks,

Brian
Brian Bartley
Campus Card Services
Indiana University
Bill Hassell
Honored Contributor

Re: monitor user activity in real time

Make sure that .sh_history is enabled on the user account. You can use tail -f ~userName/.sh_history to see commands that are entered. But the problem is you cannot see anything typed into vi or sam or other programs.

I would suggest setting up a shared session with the vendor using WebEx or TeamViewer, or LogMeIn, etc. Now someone at your company can watch every keystroke and take over if something isn't done correctly.


Bill Hassell, sysadmin
Viktor Balogh
Honored Contributor
Solution

Re: monitor user activity in real time

Hi Brian,

A much simpler method (to me, at least) would be to use the 'screen' utility. With this tool you can attach to the session of the user, and see live what he/she does. It can also be used to train a new colleague.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/screen-4.0.3/

Or, alternatively, you can use rootsh, it is a special fully-logged shell (everything gets logged from the screen) with the privileges of the root user. It must be started via sudo.

You can find HP-UX pre-compiled binaries up to version 1.5.2 here:

http://sourceforge.net/projects/rootsh/files/
****
Unix operates with beer.
Brian Bartley
Frequent Advisor

Re: monitor user activity in real time

Thanks for all replies, your comments were very helpful.

Brian
Brian Bartley
Campus Card Services
Indiana University