HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
Showing results for 
Search instead for 
Did you mean: 

keeping a log of user typed commands...

Go to solution
Respected Contributor

keeping a log of user typed commands...

Hi Guys,
i would like to maintain a log of all typed commands on my producn..
for which i have already shifted the sh_history variable in /etc/profile to a different locn...for all users...

but now th problem is i have a user called xyz...
he logs in and then he uses su - test

to log into my application...
where he fires all the commands ...related to my application ...i would like to keep a record of it....

Bcoz nw the probl is my history record shows the comands typed the applicn user which is a common user...used by atleast 4-5 people at a time..
so m not able to keep a trace of who typed whch command...

i would like to have ...
xyz_test_history commands in my log file ...

HPUX 11i v2 ..6600 ....
Richard Hepworth
Esteemed Contributor

Re: keeping a log of user typed commands...


Set your sh_history location as follows (in /etc/profile):

LOGINNAME=`who am i | awk '{print $1}'`

You can also track who su'd to different users in /var/adm/sulog


Sajjad Sahir
Honored Contributor

Re: keeping a log of user typed commands...

Dear Chindi

who is trying to su it will be log in to sulog files.

it is under /var/adm directory

thanks and regards