troubleshooting Question

How to implement auto session logging (ie Unix "script" in .profile or /etc/profile)

Avatar of sunhux
sunhux asked on
Unix OSSystem ProgrammingShell Scripting
18 Comments10 Solutions1225 ViewsLast Modified:
For change control/support purposes, our OpenVMS servers require tech support
or administrator to login to a central VMS server (which is DCL shell script menu
driven) & from there, the administrator has to choose an option on the screen that
will do "telnet/log=logfilename  target_host/IP_addr_to_access" (in OpenVMS it's
"set host/log=...   target_host/IP_addr_to_access).

Would like to implement this on Solaris/HPUX/RedHat servers - is it possible to do
this transparently to the user : it's sort of screen logger plus keylogger (but don't
capture passwords)  :
I'm thinking along the line of inserting into each individual users'  .profile (for Korn
& Bourne shell) the lines  
   script filename_userid_date_time
   ...... user gets into system to do whatever he's doing .....
   When user type "exit" or Control-D to exit,  Unix OS will
    exit twice (once to close the "scripted" file & another
    time is the actual logoff.

Appreciate specific/exact codings.

Probably can be done at /etc/profile so that I don't have to
do this to each & every user's .profile but the coding has
to be such that it only apply this to userids with the first
3 alphabets containing the text "sgp" as I don't want to
log users who login using oraxxxxxx  or  an application
related id (aworks ...).

The administrators could be login to the system from a

Certainly, if the user  sgpxxxx login & then "su root",
whatever, he types/views after the "su" should still
be logged.

Join our community to see this answer!
Unlock 10 Answers and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 10 Answers and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros