cancel
Showing results for 
Search instead for 
Did you mean: 

User command history.

Girish_84
Occasional Contributor

User command history.

Hi,
being a root user, can I see the commands run by a specific/any user.

e.g.
Username= sid

can I see all the commands run by 'sid' as root?
5 REPLIES
Michal Kapalka (mikap)
Honored Contributor

Re: User command history.

hi,

you could make history_file for each user in global profile and them you will be able to see wich commands was used


this is a hist file for root :
$HOME/.profile
...
export HISTFILE=./.sh_history
export HISTSIZE=2048

mikap
merieux
Frequent Advisor

Re: User command history.

Hi ,

Be aware . The .profile don't must be into nfs file system but on local file system

Have a good day ,
Xavier
merieux
Frequent Advisor

Re: User command history.

sory for the mistake . You have to understand HISTFILE instead .profile :-)

do not Put HISTFILE under a nfs filesytem
regards ,
Dennis Handly
Acclaimed Contributor

Re: User command history.

>merieux: do not Put HISTFILE under a NFS filesytem

This does work but could cause hangs if your server goes down.
Other issues if different HP-UX versions and shells.
Torsten.
Acclaimed Contributor

Re: User command history.

>> can I see all the commands run by 'sid' as root?


Did you mean "sid" was root and run commands?

In this case, how did sid became root? su or sudo for example?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!